[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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View file

@ -100,7 +100,7 @@ class MrssFormat extends FormatAbstract {
$itemTimestamp = $item->getTimestamp();
$itemTitle = $item->getTitle();
$itemUri = $item->getURI();
$itemContent = $this->sanitizeHtml($item->getContent());
$itemContent = $item->getContent() ? $this->sanitizeHtml($item->getContent()) : '';
$entryID = $item->getUid();
$isPermaLink = 'false';