Fallback for feeds with empty title (#3787)

* Fallback for feeds with empty title
Address a part of https://github.com/FreshRSS/FreshRSS/issues/3776 for existing feeds

* Also strip www prefix

* Reuse fallback logic
This commit is contained in:
Alexandre Alapetite
2021-08-22 13:33:58 +02:00
committed by GitHub
parent 93f759fd4f
commit ee2d2db780
3 changed files with 7 additions and 6 deletions

View File

@@ -470,10 +470,11 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
}
if ($simplePie != null) {
if (trim($feed->name()) == '') {
if ($feed->name(true) == '') {
//HTML to HTML-PRE //ENT_COMPAT except '&'
$name = strtr(html_only_entity_decode($simplePie->get_title()), array('<' => '&lt;', '>' => '&gt;', '"' => '&quot;'));
$feedProperties['name'] = $name == '' ? $feed->url() : $name;
$feed->_name($name);
$feedProperties['name'] = $feed->name(false);
}
if (trim($feed->website()) == '') {
$website = html_only_entity_decode($simplePie->get_link());