diff options
| author | 2022-03-23 11:39:31 +0100 | |
|---|---|---|
| committer | 2022-03-23 11:39:31 +0100 | |
| commit | 954cc0510d77301f69860db585632f69c0417411 (patch) | |
| tree | d6688f69a3562f30012ab2f35df2bea0b8b2ed55 /app/Models/Feed.php | |
| parent | 92b0ffe05cd426b85fe2575b8d9a1d39b1410b3c (diff) | |
HTML+XPath fallback to feed title (#4288)
* HTML+XPath fallback to feed title
Except when adding the feed, the following refreshes should fallback to feed title when generating the internal RSS representation.
Improvement of https://github.com/FreshRSS/FreshRSS/pull/4220
Diffstat (limited to 'app/Models/Feed.php')
| -rw-r--r-- | app/Models/Feed.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/Models/Feed.php b/app/Models/Feed.php index 30e2e7bd4..e0d26046b 100644 --- a/app/Models/Feed.php +++ b/app/Models/Feed.php @@ -601,7 +601,8 @@ class FreshRSS_Feed extends Minz_Model { $doc->strictErrorChecking = false; $doc->loadHTML($html, LIBXML_NONET | LIBXML_NOERROR | LIBXML_NOWARNING); $xpath = new DOMXPath($doc); - $view->rss_title = $xPathFeedTitle == '' ? '' : htmlspecialchars(@$xpath->evaluate('normalize-space(' . $xPathFeedTitle . ')'), ENT_COMPAT, 'UTF-8'); + $view->rss_title = $xPathFeedTitle == '' ? $this->name() : + htmlspecialchars(@$xpath->evaluate('normalize-space(' . $xPathFeedTitle . ')'), ENT_COMPAT, 'UTF-8'); $view->rss_base = htmlspecialchars(trim($xpath->evaluate('normalize-space(//base/@href)')), ENT_COMPAT, 'UTF-8'); $nodes = $xpath->query($xPathItem); if (empty($nodes)) { |
