Skip to content

Commit

Permalink
fix - Notice: Undefined variable: uploaded_bytes when reupload same file
Browse files Browse the repository at this point in the history
  • Loading branch information
artgris committed Sep 18, 2020
1 parent 42741da commit c23a016
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions Helpers/UploadHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit c23a016

Please sign in to comment.