From c23a01694ca6e834da0bc1b213ffc6f019422466 Mon Sep 17 00:00:00 2001 From: artgris Date: Fri, 18 Sep 2020 09:06:09 +0200 Subject: [PATCH] fix - Notice: Undefined variable: uploaded_bytes when reupload same file --- Helpers/UploadHandler.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Helpers/UploadHandler.php b/Helpers/UploadHandler.php index a93d28f..214c881 100644 --- a/Helpers/UploadHandler.php +++ b/Helpers/UploadHandler.php @@ -385,10 +385,10 @@ public function get_config_bytes($val) switch ($last) { case 'g': $val *= 1024; - // no break + // no break case 'm': $val *= 1024; - // no break + // no break case 'k': $val *= 1024; } @@ -524,9 +524,7 @@ protected function get_unique_filename($file_path, $name, $size, $type, $error, $name = $this->upcount_name($name); } // Keep an existing filename if this is part of a chunked upload: - if (isset($content_range)) { - $uploaded_bytes = $this->fix_integer_overflow((int) $content_range[1]); - } + $uploaded_bytes = $this->fix_integer_overflow((int)@$content_range[1]); while (is_file($this->get_upload_path($name))) { if ($uploaded_bytes === $this->get_file_size( $this->get_upload_path($name)) @@ -846,7 +844,7 @@ protected function gd_create_scaled_image($file_name, $version, $options) case 'gif': case 'png': imagecolortransparent($new_img, imagecolorallocate($new_img, 0, 0, 0)); - // no break + // no break case 'png': imagealphablending($new_img, false); imagesavealpha($new_img, true);