diff options
| author | 2023-11-14 12:58:57 +0100 | |
|---|---|---|
| committer | 2023-11-14 12:58:57 +0100 | |
| commit | 9eba8726ac08d75730a9ed5fd26047f502007dfd (patch) | |
| tree | 3e21d1c25f3632ef6dd16e5294a60f5d68827e84 /app | |
| parent | b1d568697ad031a42b478ea6a3316558deaaa7c3 (diff) | |
API fix add feed with title (#5868)
fix https://github.com/FreshRSS/FreshRSS/issues/5866
Diffstat (limited to 'app')
| -rw-r--r-- | app/Models/Feed.php | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/app/Models/Feed.php b/app/Models/Feed.php index ed1468744..38c6ca37e 100644 --- a/app/Models/Feed.php +++ b/app/Models/Feed.php @@ -400,12 +400,17 @@ class FreshRSS_Feed extends Minz_Model { // si on a utilisé l’auto-discover, notre url va avoir changé $subscribe_url = $simplePie->subscribe_url(false); - //HTML to HTML-PRE //ENT_COMPAT except '&' - $title = strtr(html_only_entity_decode($simplePie->get_title()), ['<' => '<', '>' => '>', '"' => '"']); - $this->_name($title == '' ? $this->url : $title); - - $this->_website(html_only_entity_decode($simplePie->get_link())); - $this->_description(html_only_entity_decode($simplePie->get_description())); + if ($this->name(true) === '') { + //HTML to HTML-PRE //ENT_COMPAT except '&' + $title = strtr(html_only_entity_decode($simplePie->get_title()), ['<' => '<', '>' => '>', '"' => '"']); + $this->_name($title == '' ? $this->url : $title); + } + if ($this->website() === '') { + $this->_website(html_only_entity_decode($simplePie->get_link())); + } + if ($this->description() === '') { + $this->_description(html_only_entity_decode($simplePie->get_description())); + } } else { //The case of HTTP 301 Moved Permanently $subscribe_url = $simplePie->subscribe_url(true); |
