Permalink
Browse files

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")
  • Loading branch information...
1 parent 7040218 commit c3585a3a514af4a4214b641b64156af455b2ec41 @gosa gosa committed Mar 13, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 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;

0 comments on commit c3585a3

Please sign in to comment.