summaryrefslogtreecommitdiffstats
path: root/fetcher
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2014-02-11 16:05:37 +0100
committerBernhard Posselt <dev@bernhard-posselt.com>2014-02-11 16:05:58 +0100
commit99af7d32d42d7b77bae4f7747c02db959f35d668 (patch)
tree97e9141c60fb21e7e38b785d0b278da7e31792ca /fetcher
parentd5eab3852c1c6629be6b29016e67e374d85f78ac (diff)
fix XSS when importing articles, speed up update and adding of feeds by only purifying content that will be added to the db
Diffstat (limited to 'fetcher')
-rw-r--r--fetcher/feedfetcher.php15
1 files changed, 4 insertions, 11 deletions
diff --git a/fetcher/feedfetcher.php b/fetcher/feedfetcher.php
index fc9f4eae6..aa1f94e5b 100644
--- a/fetcher/feedfetcher.php
+++ b/fetcher/feedfetcher.php
@@ -42,8 +42,7 @@ class FeedFetcher implements IFeedFetcher {
private $faviconFetcher;
private $simplePieFactory;
private $fetchTimeout;
- private $time;
- private $purifier;
+ private $time;
public function __construct(API $api,
SimplePieAPIFactory $simplePieFactory,
@@ -51,15 +50,13 @@ class FeedFetcher implements IFeedFetcher {
TimeFactory $time,
$cacheDirectory,
$cacheDuration,
- $fetchTimeout,
- $purifier){
+ $fetchTimeout){
$this->api = $api;
$this->cacheDirectory = $cacheDirectory;
$this->cacheDuration = $cacheDuration;
$this->faviconFetcher = $faviconFetcher;
$this->simplePieFactory = $simplePieFactory;
$this->time = $time;
- $this->purifier = $purifier;
$this->fetchTimeout = $fetchTimeout;
}
@@ -143,12 +140,8 @@ class FeedFetcher implements IFeedFetcher {
$guid = $simplePieItem->get_id();
$item->setGuid($guid);
- // links should always open in a new window
- $item->setBody(
- $this->purifier->purify(
- $simplePieItem->get_content()
- )
- );
+ // purification is done in the businesslayer
+ $item->setBody($simplePieItem->get_content());
// pubdate is not required. if not given use the current date
$date = $simplePieItem->get_date('U');