mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-13 03:15:56 +00:00
parser: use node->c14n() instead of expecting html in nodeValue
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user