summaryrefslogtreecommitdiffstats
path: root/utility
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2013-07-25 00:43:00 +0200
committerBernhard Posselt <nukeawhale@gmail.com>2013-07-25 00:43:00 +0200
commiteac8eca7a35fedb899312424d518f3b75269bad7 (patch)
tree9fe61dc6617cffde5f993d73b7ed8d15f6a67819 /utility
parentb655fc74e433df15f61a00963581f2775e9ddbc1 (diff)
clean up indention
Diffstat (limited to 'utility')
-rw-r--r--utility/feedfetcher.php21
1 files changed, 14 insertions, 7 deletions
diff --git a/utility/feedfetcher.php b/utility/feedfetcher.php
index c3568ab63..217723d83 100644
--- a/utility/feedfetcher.php
+++ b/utility/feedfetcher.php
@@ -115,11 +115,12 @@ class FeedFetcher implements IFeedFetcher {
$item = new Item();
$item->setStatus(0);
$item->setUnread();
- $item->setUrl(html_entity_decode($simplePieItem->get_permalink(),
- ENT_COMPAT, 'UTF-8'));
+ $item->setUrl(
+ html_entity_decode($simplePieItem->get_permalink(), ENT_COMPAT, 'UTF-8')
+ );
+
// unescape content because angularjs helps against XSS
- // unescape again to clean up fucktard's RSS feeds who escape twice
- // (I'm looking at you slashdot)
+ // unescape again to clean up stuff that was escaped
$item->setTitle(
html_entity_decode(
html_entity_decode($simplePieItem->get_title(), ENT_COMPAT, 'UTF-8'),
@@ -128,9 +129,15 @@ class FeedFetcher implements IFeedFetcher {
$guid = $simplePieItem->get_id();
$item->setGuid($guid);
$item->setGuidHash(md5($guid));
- $item->setBody(str_replace('<a', '<a target="_blank"',
- // escape XSS
- $this->purifier->purify($simplePieItem->get_content())));
+
+ // links should always open in a new window
+ $item->setBody(
+ str_replace(
+ '<a', '<a target="_blank"', $this->purifier->purify(
+ $simplePieItem->get_content()
+ )
+ )
+ );
// pubdate is not required. if not given use the current date
$date = $simplePieItem->get_date('U');