From c3585a3a514af4a4214b641b64156af455b2ec41 Mon Sep 17 00:00:00 2001 From: gosa Date: Wed, 13 Mar 2013 13:28:01 +0100 Subject: [PATCH] Update File.php There is PHP error "Filename cannot be empty" when someone tries to instantiate SimplePie_File object with bad URI (e.g. URI without schema "www.vg.no/rss/create.php?categories=21,20&keywords=&limit=10") --- library/SimplePie/File.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/SimplePie/File.php b/library/SimplePie/File.php index 2f1cfedc1..be5b22b6d 100644 --- a/library/SimplePie/File.php +++ b/library/SimplePie/File.php @@ -282,7 +282,7 @@ public function __construct($url, $timeout = 10, $redirects = 5, $headers = null else { $this->method = SIMPLEPIE_FILE_SOURCE_LOCAL | SIMPLEPIE_FILE_SOURCE_FILE_GET_CONTENTS; - if (!$this->body = file_get_contents($url)) + if (empty($url) || !($this->body = file_get_contents($url))) { $this->error = 'file_get_contents could not read the file'; $this->success = false;