diff options
| author | 2022-10-04 23:07:17 +0200 | |
|---|---|---|
| committer | 2022-10-04 23:07:17 +0200 | |
| commit | 82c4a54fea408a20445b04feea5f533c21b942f6 (patch) | |
| tree | 40115b348cc68e9a97389bcee9386a4c56d2e7cc /app/Models/Feed.php | |
| parent | 267b55154b31da99d8df5d5122ff84c8b80a2dc1 (diff) | |
Compat PHP 8.1 strip_tags (#4688)
#fix https://github.com/FreshRSS/FreshRSS/issues/4687
Diffstat (limited to 'app/Models/Feed.php')
| -rw-r--r-- | app/Models/Feed.php | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/app/Models/Feed.php b/app/Models/Feed.php index 710f8b557..b9a34b90a 100644 --- a/app/Models/Feed.php +++ b/app/Models/Feed.php @@ -559,19 +559,22 @@ class FreshRSS_Feed extends Minz_Model { $guid = safe_ascii($item->get_id(false, false)); unset($item); - $author_names = ''; + $authorNames = ''; if (is_array($authors)) { foreach ($authors as $author) { - $author_names .= escapeToUnicodeAlternative(strip_tags($author->name == '' ? $author->email : $author->name), true) . '; '; + $authorName = $author->name != '' ? $author->name : $author->email; + if ($authorName != '') { + $authorNames .= escapeToUnicodeAlternative(strip_tags($authorName), true) . '; '; + } } } - $author_names = substr($author_names, 0, -2); + $author_names = substr($authorNames, 0, -2); $entry = new FreshRSS_Entry( $this->id(), $hasBadGuids ? '' : $guid, $title == '' ? '' : $title, - $author_names, + $authorNames, $content == '' ? '' : $content, $link == '' ? '' : $link, $date ? $date : time() |
