Allow HTML in all item content

RSS description may contain encoded entities
This commit is contained in:
2024-04-14 20:05:39 -04:00
parent fe16ec7281
commit c74d9ccb74
4 changed files with 6 additions and 18 deletions

View File

@@ -51,7 +51,6 @@ if ($item) {
$published = date_time($item['published_on']);
$updated = isset($item['updated_on']) ? date_time($item['updated_on']) : null;
$isEncoded = (bool) $item['is_encoded'];
page_head(htmlentities("{$item['item_title']} | {$item['feed_title']}")); ?>
<h1 class=item_heading>
@@ -62,13 +61,7 @@ page_head(htmlentities("{$item['item_title']} | {$item['feed_title']}")); ?>
Published <?=date_time($item['published_on'])?><?=$updated && $updated != $published ? " (Updated $updated)" : ''?>
</div>
<article>
<div class=item_content><?php
if ($isEncoded) {
echo str_replace('<a ', '<a target=_blank rel=noopener ', $item['content']);
} else {
echo htmlentities($item['content']);
} ?>
</div>
<div class=item_content><?=str_replace('<a ', '<a target=_blank rel=noopener ', $item['content'])?></div>
<form class=action_buttons action=/item method=POST>
<input type=hidden name=id value=<?=$_GET['id']?>>
<a href="/">Done</a>