Allow HTML in all item content
RSS description may contain encoded entities
This commit is contained in:
@@ -56,7 +56,6 @@ class Data {
|
||||
published_on TEXT NOT NULL,
|
||||
updated_on TEXT,
|
||||
content TEXT NOT NULL,
|
||||
is_encoded BOOLEAN NOT NULL,
|
||||
is_read BOOLEAN NOT NULL DEFAULT 0,
|
||||
is_bookmarked BOOLEAN NOT NULL DEFAULT 0,
|
||||
FOREIGN KEY (feed_id) REFERENCES feed (id))
|
||||
|
||||
@@ -129,8 +129,7 @@ class Feed {
|
||||
'published' => Data::formatDate(self::eltValue($item, 'pubDate')),
|
||||
'updated' => Data::formatDate($updNodes->length > 0 ? $updNodes->item(0)->textContent : null),
|
||||
'content' => $encNodes->length > 0 ? $encNodes->item(0)->textContent
|
||||
: self::eltValue($item, 'description'),
|
||||
'isEncoded' => $encNodes->length > 0
|
||||
: self::eltValue($item, 'description')
|
||||
];
|
||||
}
|
||||
|
||||
@@ -148,7 +147,6 @@ class Feed {
|
||||
published_on = :published,
|
||||
updated_on = :updated,
|
||||
content = :content,
|
||||
is_encoded = :encoded,
|
||||
is_read = 0
|
||||
WHERE id = :id
|
||||
SQL);
|
||||
@@ -156,7 +154,6 @@ class Feed {
|
||||
$query->bindValue(':published', $item['published']);
|
||||
$query->bindValue(':updated', $item['updated']);
|
||||
$query->bindValue(':content', $item['content']);
|
||||
$query->bindValue(':encoded', $item['isEncoded']);
|
||||
$query->bindValue(':id', $itemId);
|
||||
$query->execute();
|
||||
}
|
||||
@@ -171,9 +168,9 @@ class Feed {
|
||||
private static function addItem(int $feedId, array $item, SQLite3 $db): void {
|
||||
$query = $db->prepare(<<<'SQL'
|
||||
INSERT INTO item (
|
||||
feed_id, item_guid, item_link, title, published_on, updated_on, content, is_encoded
|
||||
feed_id, item_guid, item_link, title, published_on, updated_on, content
|
||||
) VALUES (
|
||||
:feed, :guid, :link, :title, :published, :updated, :content, :encoded
|
||||
:feed, :guid, :link, :title, :published, :updated, :content
|
||||
)
|
||||
SQL);
|
||||
$query->bindValue(':feed', $feedId);
|
||||
@@ -183,7 +180,6 @@ class Feed {
|
||||
$query->bindValue(':published', $item['published']);
|
||||
$query->bindValue(':updated', $item['updated']);
|
||||
$query->bindValue(':content', $item['content']);
|
||||
$query->bindValue(':encoded', $item['isEncoded']);
|
||||
$query->execute();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user