diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2013-04-28 17:11:15 +0200 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2013-04-28 17:11:15 +0200 |
commit | 4be605e3ca660b6c8da3540cd40bd3400da7812a (patch) | |
tree | 93c8b809946203a9c03269acfb977220687c9a5a /utility/feedfetcher.php | |
parent | b45d8fe4db1d54b90db7eac1d027045a1d02989b (diff) |
try to fix #139 by specifying utf-8 encoding and xml entities manually
Diffstat (limited to 'utility/feedfetcher.php')
-rw-r--r-- | utility/feedfetcher.php | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/utility/feedfetcher.php b/utility/feedfetcher.php index 3d4a5099c..0fea5d1b7 100644 --- a/utility/feedfetcher.php +++ b/utility/feedfetcher.php @@ -110,7 +110,8 @@ class FeedFetcher implements IFeedFetcher { $item->setUnread(); $item->setUrl($simplePieItem->get_permalink()); // unescape content because angularjs helps agains XSS - $item->setTitle(html_entity_decode($simplePieItem->get_title())); + $item->setTitle(html_entity_decode($simplePieItem->get_title()), + ENT_XML1 | ENT_COMPAT, 'UTF-8' ); $guid = $simplePieItem->get_id(); $item->setGuid($guid); $item->setGuidHash(md5($guid)); @@ -120,11 +121,13 @@ class FeedFetcher implements IFeedFetcher { $author = $simplePieItem->get_author(); if ($author !== null) { - $name = html_entity_decode($author->get_name()); + $name = html_entity_decode($author->get_name(), + ENT_XML1 | ENT_COMPAT, 'UTF-8' ); if ($name) { $item->setAuthor($name); } else { - $item->setAuthor(html_entity_decode($author->get_email())); + $item->setAuthor(html_entity_decode($author->get_email()), + ENT_XML1 | ENT_COMPAT, 'UTF-8' ); } } @@ -146,7 +149,8 @@ class FeedFetcher implements IFeedFetcher { $feed = new Feed(); // unescape content because angularjs helps agains XSS - $title = html_entity_decode($simplePieFeed->get_title()); + $title = html_entity_decode($simplePieFeed->get_title(), + ENT_XML1 | ENT_COMPAT, 'UTF-8' ); // if there is no title use the url if(!$title) { |