From 5d56d100f1acaee498b6d7da12c4bf10f416c49f Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 26 Feb 2013 18:27:40 +0400 Subject: [PATCH] force disable simplepie unnecessarily sanitizing data --- classes/sanitizedummy.php | 7 +++++++ include/rssfuncs.php | 8 ++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 classes/sanitizedummy.php diff --git a/classes/sanitizedummy.php b/classes/sanitizedummy.php new file mode 100644 index 000000000..a184bec30 --- /dev/null +++ b/classes/sanitizedummy.php @@ -0,0 +1,7 @@ + diff --git a/include/rssfuncs.php b/include/rssfuncs.php index b82a872f4..bced183f4 100644 --- a/include/rssfuncs.php +++ b/include/rssfuncs.php @@ -291,6 +291,10 @@ } $rss = new SimplePie(); + $rss->set_sanitize_class("SanitizeDummy"); + // simplepie ignores the above and creates default sanitizer anyway, + // so let's override it... + $rss->sanitize = new SanitizeDummy(); $rss->set_output_encoding('UTF-8'); $rss->set_raw_data($feed_data); @@ -438,7 +442,7 @@ } foreach ($items as $item) { - if ($_REQUEST['xdebug'] == 2) { + if ($_REQUEST['xdebug'] == 3) { print_r($item); } @@ -473,7 +477,7 @@ $entry_title = $item->get_title(); - $entry_link = rewrite_relative_url($site_url, htmlspecialchars_decode($item->get_link())); + $entry_link = rewrite_relative_url($site_url, $item->get_link()); if ($debug_enabled) { _debug("update_rss_feed: title $entry_title");