aboutsummaryrefslogtreecommitdiff
path: root/app/Models/Feed.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2022-03-23 11:39:31 +0100
committerGravatar GitHub <noreply@github.com> 2022-03-23 11:39:31 +0100
commit954cc0510d77301f69860db585632f69c0417411 (patch)
treed6688f69a3562f30012ab2f35df2bea0b8b2ed55 /app/Models/Feed.php
parent92b0ffe05cd426b85fe2575b8d9a1d39b1410b3c (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.php3
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)) {