summaryrefslogtreecommitdiff
path: root/lib/lib_rss.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2014-01-19 22:25:49 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2014-01-19 22:25:49 +0100
commit4e4b0f717fe0a8378e2b751393a8c19d1ada6eb2 (patch)
tree6b268cfe46eb3eee8ebaddcd1e17067eaca0214f /lib/lib_rss.php
parent12e0b6b094041fc22937520b3218e4f61915fd50 (diff)
parent79d4893fc792119c390d2f744246df210b74f637 (diff)
Merge remote-tracking branch 'origin/dev' into beta
Diffstat (limited to 'lib/lib_rss.php')
-rw-r--r--lib/lib_rss.php14
1 files changed, 3 insertions, 11 deletions
diff --git a/lib/lib_rss.php b/lib/lib_rss.php
index 4f98ed14a..33d7ebc32 100644
--- a/lib/lib_rss.php
+++ b/lib/lib_rss.php
@@ -110,6 +110,7 @@ function sanitizeHTML($data) {
static $simplePie = null;
if ($simplePie == null) {
$simplePie = new SimplePie();
+ $simplePie->init();
}
return html_only_entity_decode($simplePie->sanitize->sanitize($data, SIMPLEPIE_CONSTRUCT_MAYBE_HTML));
}
@@ -118,22 +119,13 @@ function sanitizeHTML($data) {
function get_content_by_parsing ($url, $path) {
require_once (LIB_PATH . '/lib_phpQuery.php');
+ syslog(LOG_INFO, 'FreshRSS GET ' . $url);
$html = file_get_contents ($url);
if ($html) {
$doc = phpQuery::newDocument ($html);
$content = $doc->find ($path);
- $content->find ('*')->removeAttr ('style')
- ->removeAttr ('id')
- ->removeAttr ('class')
- ->removeAttr ('onload')
- ->removeAttr ('target');
- $content->removeAttr ('style')
- ->removeAttr ('id')
- ->removeAttr ('class')
- ->removeAttr ('onload')
- ->removeAttr ('target');
- return $content->__toString ();
+ return sanitizeHTML($content->__toString());
} else {
throw new Exception ();
}