Skip to content

Commit

Permalink
Update File.php
Browse files Browse the repository at this point in the history
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")
Rate limit · GitHub

Access has been restricted

You have triggered a rate limit.

Please wait a few minutes before you try again;
in some cases this may take up to an hour.

gosa committed Mar 13, 2013
1 parent 7040218 commit c3585a3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/SimplePie/File.php
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit c3585a3

Please sign in to comment.