From 1383514ad9e7630a3d9627e052780b8fcadab25a Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sat, 23 Jan 2016 01:04:24 +0300 Subject: [PATCH] parser: use node->c14n() instead of expecting html in nodeValue --- classes/feeditem/atom.php | 4 ++-- classes/feeditem/rss.php | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/classes/feeditem/atom.php b/classes/feeditem/atom.php index dfac7149..7990a61c 100644 --- a/classes/feeditem/atom.php +++ b/classes/feeditem/atom.php @@ -75,7 +75,7 @@ class FeedItem_Atom extends FeedItem_Common { } } - return $content->nodeValue; + return $content->c14n(); } } @@ -95,7 +95,7 @@ class FeedItem_Atom extends FeedItem_Common { } } - return $content->nodeValue; + return $content->c14n(); } } diff --git a/classes/feeditem/rss.php b/classes/feeditem/rss.php index 27a364b8..95f3acde 100644 --- a/classes/feeditem/rss.php +++ b/classes/feeditem/rss.php @@ -71,17 +71,16 @@ class FeedItem_RSS extends FeedItem_Common { $contentB = $this->elem->getElementsByTagName("description")->item(0); if ($contentA && !$contentB) { - return $contentA->nodeValue; + return $contentA->c14n(); } - if ($contentB && !$contentA) { - return $contentB->nodeValue; + return $contentB->c14n(); } if ($contentA && $contentB) { return mb_strlen($contentA->nodeValue) > mb_strlen($contentB->nodeValue) ? - $contentA->nodeValue : $contentB->nodeValue; + $contentA->c14n() : $contentB->c14n(); } } @@ -89,7 +88,7 @@ class FeedItem_RSS extends FeedItem_Common { $summary = $this->elem->getElementsByTagName("description")->item(0); if ($summary) { - return $summary->nodeValue; + return $summary->c14n(); } }