summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2014-02-11 02:37:41 +0100
committerBernhard Posselt <dev@bernhard-posselt.com>2014-02-11 02:37:48 +0100
commitc638ef6f065df8d8311d9bab7802f9c97526dca4 (patch)
treedf3292884a76affa93323f817490f08d3f6c9eaf
parent2622ae63e0dcbcde5337e1837498cecc64ce65be (diff)
disable simplepie caching, see https://github.com/simplepie/simplepie/issues/345#issuecomment-34718099
-rw-r--r--fetcher/feedfetcher.php2
-rw-r--r--tests/unit/fetcher/FeedFetcherTest.php3
2 files changed, 5 insertions, 0 deletions
diff --git a/fetcher/feedfetcher.php b/fetcher/feedfetcher.php
index 64ab73d68..fc9f4eae6 100644
--- a/fetcher/feedfetcher.php
+++ b/fetcher/feedfetcher.php
@@ -82,6 +82,8 @@ class FeedFetcher implements IFeedFetcher {
$simplePie = $this->simplePieFactory->getCore();
$simplePie->set_feed_url($url);
$simplePie->enable_cache(true);
+ $simplePie->set_stupidly_fast(true); // disable simple pie sanitation
+ // we use htmlpurifier
$simplePie->set_timeout($this->fetchTimeout);
$simplePie->set_cache_location($this->cacheDirectory);
$simplePie->set_cache_duration($this->cacheDuration);
diff --git a/tests/unit/fetcher/FeedFetcherTest.php b/tests/unit/fetcher/FeedFetcherTest.php
index b9f68fdae..da7348fc9 100644
--- a/tests/unit/fetcher/FeedFetcherTest.php
+++ b/tests/unit/fetcher/FeedFetcherTest.php
@@ -141,6 +141,9 @@ class FeedFetcherTest extends \OCA\AppFramework\Utility\TestUtility {
->method('set_cache_location')
->with($this->equalTo($this->cacheDirectory));
$this->core->expects($this->once())
+ ->method('set_stupidly_fast')
+ ->with($this->equalTo(true));
+ $this->core->expects($this->once())
->method('set_cache_duration')
->with($this->equalTo($this->cacheDuration));
$this->setExpectedException('\OCA\News\Fetcher\FetcherException');