1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-07-30 21:30:14 +02:00

[FormatAbstract]: Ensure sanitizeHtml is given string (#2791)

Sometimes `Item::getContent` returns `null`, in which case `sanitizeHtml`
would pass it to `str_replace`, which would raise `E_DEPRECATED` on PHP 8.1.
This commit is contained in:
Jan Tojnar
2022-06-17 20:46:15 +02:00
committed by GitHub
parent 9ac494b350
commit 10eb1c9a95
3 changed files with 3 additions and 3 deletions

View File

@@ -49,7 +49,7 @@ class JsonFormat extends FormatAbstract {
$entryTitle = $item->getTitle();
$entryUri = $item->getURI();
$entryTimestamp = $item->getTimestamp();
$entryContent = $this->sanitizeHtml($item->getContent());
$entryContent = $item->getContent() ? $this->sanitizeHtml($item->getContent()) : '';
$entryEnclosures = $item->getEnclosures();
$entryCategories = $item->getCategories();