Skip to content

Commit

Permalink
Change Upload.php for image/webp
Browse files Browse the repository at this point in the history
  • Loading branch information
Devesa Agustín authored Jan 8, 2020
1 parent 0db8b60 commit f0a6de5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions system/libraries/Upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,7 @@ public function is_image()
$this->file_type = 'image/jpeg';
}

$img_mimes = array('image/gif', 'image/jpeg', 'image/png');
$img_mimes = array('image/gif', 'image/jpeg', 'image/png', 'image/webp');

return in_array($this->file_type, $img_mimes, TRUE);
}
Expand Down Expand Up @@ -901,8 +901,7 @@ public function is_allowed_filetype($ignore_mime = FALSE)
}

// Images get some additional checks
if (in_array($ext, array('gif', 'jpg', 'jpeg', 'jpe', 'png'), TRUE) && @getimagesize($this->file_temp) === FALSE)
{
if (in_array($ext, array('gif', 'jpg', 'jpeg', 'jpe', 'png','webp'), TRUE) && @getimagesize($this->file_temp) === FALSE){
return FALSE;
}

Expand Down

0 comments on commit f0a6de5

Please sign in to comment.