summaryrefslogtreecommitdiffstats
path: root/utility
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2013-07-25 00:08:06 +0200
committerBernhard Posselt <nukeawhale@gmail.com>2013-07-25 00:08:06 +0200
commitb655fc74e433df15f61a00963581f2775e9ddbc1 (patch)
treeb000b0eaa2a712380ed99c8bcc85013924dfb92e /utility
parentedab5dd72350785a9fed85d068704381181be791 (diff)
decode title twice to fix stupid feed authors' mistakes
Diffstat (limited to 'utility')
-rw-r--r--utility/feedfetcher.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/utility/feedfetcher.php b/utility/feedfetcher.php
index 4706f7612..c3568ab63 100644
--- a/utility/feedfetcher.php
+++ b/utility/feedfetcher.php
@@ -118,8 +118,13 @@ class FeedFetcher implements IFeedFetcher {
$item->setUrl(html_entity_decode($simplePieItem->get_permalink(),
ENT_COMPAT, 'UTF-8'));
// unescape content because angularjs helps against XSS
- $item->setTitle(html_entity_decode($simplePieItem->get_title(),
- ENT_COMPAT, 'UTF-8'));
+ // unescape again to clean up fucktard's RSS feeds who escape twice
+ // (I'm looking at you slashdot)
+ $item->setTitle(
+ html_entity_decode(
+ html_entity_decode($simplePieItem->get_title(), ENT_COMPAT, 'UTF-8'),
+ ENT_COMPAT, 'UTF-8')
+ );
$guid = $simplePieItem->get_id();
$item->setGuid($guid);
$item->setGuidHash(md5($guid));