Prevents php warning when trying to retrieve a non-existing image (Closes #1146).
authorStéphane Jacob <sj@m4x.org>
Fri, 10 Sep 2010 12:23:16 +0000 (14:23 +0200)
committerStéphane Jacob <sj@m4x.org>
Fri, 10 Sep 2010 12:23:28 +0000 (14:23 +0200)
Signed-off-by: Stéphane Jacob <sj@m4x.org>
classes/plupload.php

index 7654830..deabf04 100644 (file)
@@ -113,7 +113,11 @@ class PlUpload
             trigger_error('malformed URL given', E_USER_NOTICE);
             return false;
         }
-        $data = file_get_contents($url);
+        if (file_exists($url)) {
+            $data = file_get_contents($url);
+        } else {
+            return false;
+        }
         if (!$data) {
             return false;
         }