From adf0fa2119688cf61ca23b7bc23b0730af702c6d Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Fri, 10 Sep 2010 14:23:16 +0200 Subject: [PATCH] Prevents php warning when trying to retrieve a non-existing image (Closes #1146). MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Jacob --- classes/plupload.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/classes/plupload.php b/classes/plupload.php index 7654830..deabf04 100644 --- a/classes/plupload.php +++ b/classes/plupload.php @@ -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; } -- 2.1.4