Skip to content
Snippets Groups Projects
Commit 1b567b2a authored by Christopher Schäpers's avatar Christopher Schäpers
Browse files

Don't throw a fatal, if is_file() parameter isn't

a 'valid path', but only a data/base64-string.

Related to #4283
parent 0c1008bb
Branches
No related tags found
No related merge requests found
...@@ -392,7 +392,7 @@ class OC_Image { ...@@ -392,7 +392,7 @@ class OC_Image {
*/ */
public function loadFromFile($imagepath=false) { public function loadFromFile($imagepath=false) {
// exif_imagetype throws "read error!" if file is less than 12 byte // exif_imagetype throws "read error!" if file is less than 12 byte
if(!is_file($imagepath) || !file_exists($imagepath) || filesize($imagepath) < 12 || !is_readable($imagepath)) { if(!@is_file($imagepath) || !file_exists($imagepath) || filesize($imagepath) < 12 || !is_readable($imagepath)) {
// Debug output disabled because this method is tried before loadFromBase64? // Debug output disabled because this method is tried before loadFromBase64?
OC_Log::write('core', 'OC_Image->loadFromFile, couldn\'t load: '.$imagepath, OC_Log::DEBUG); OC_Log::write('core', 'OC_Image->loadFromFile, couldn\'t load: '.$imagepath, OC_Log::DEBUG);
return false; return false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment