diff --git a/inc/FeedParser.php b/inc/FeedParser.php index f2aeb4e7bebc7b12a85649d8a4443baff655a880..7c0071af0b191637c538cb3a2416ab7db4f8493c 100644 --- a/inc/FeedParser.php +++ b/inc/FeedParser.php @@ -25,9 +25,11 @@ class FeedParser extends SimplePie { /** * Fetch an URL using our own HTTPClient + * + * Overrides SimplePie's own method */ - function getFile($url){ + function get_file($url){ $http = new DokuHTTPClient(); - return $http->get($url); + return $http->get($url,true); } } diff --git a/inc/HTTPClient.php b/inc/HTTPClient.php index 18f4435bc6071a5d9a826861591993bd556333ca..69a384487c99ba94ec50b03da3b304cf203c34a6 100644 --- a/inc/HTTPClient.php +++ b/inc/HTTPClient.php @@ -111,10 +111,13 @@ class HTTPClient { * * Returns the wanted page or false on an error; * + * @param string $url The URL to fetch + * @param bool $sloppy304 Return body on 304 not modified * @author Andreas Gohr <andi@splitbrain.org> */ - function get($url){ + function get($url,$sloppy304=false){ if(!$this->sendRequest($url)) return false; + if($this->status == 304 && $sloppy304) return $this->resp_body; if($this->status != 200) return false; return $this->resp_body; }