aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--formats/JsonFormat.php2
-rw-r--r--formats/MrssFormat.php2
-rw-r--r--lib/FormatAbstract.php2
3 files changed, 3 insertions, 3 deletions
diff --git a/formats/JsonFormat.php b/formats/JsonFormat.php
index 90bae863..1efc87fe 100644
--- a/formats/JsonFormat.php
+++ b/formats/JsonFormat.php
@@ -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();
diff --git a/formats/MrssFormat.php b/formats/MrssFormat.php
index 441d2917..386b7d37 100644
--- a/formats/MrssFormat.php
+++ b/formats/MrssFormat.php
@@ -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';
diff --git a/lib/FormatAbstract.php b/lib/FormatAbstract.php
index 5514b0b5..768b0157 100644
--- a/lib/FormatAbstract.php
+++ b/lib/FormatAbstract.php
@@ -130,7 +130,7 @@ abstract class FormatAbstract implements FormatInterface {
* @todo Maybe switch to http://htmlpurifier.org/
* @todo Maybe switch to http://www.bioinformatics.org/phplabware/internal_utilities/htmLawed/index.php
*/
- protected function sanitizeHtml($html)
+ protected function sanitizeHtml(string $html): string
{
$html = str_replace('<script', '<&zwnj;script', $html); // Disable scripts, but leave them visible.
$html = str_replace('<iframe', '<&zwnj;iframe', $html);