mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-12-02 13:32:43 -05:00
fix: do not double-encode titles and authors when importing JSON (#9556)
* fix: do not double-encode titles and authors when importing JSON FreshRSS exports titles and authors HTML-encoded, and the JSON import encoded them again since #9168, so restoring a ZIP export turned "Post & more" into "Post &amp; more". Decode before encoding. * Unit test * Reduce comments --------- Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
This commit is contained in:
1 parent
3b368e0249
commit
2ce6f1125b
2 files changed
+17
-2
No files matched your search
@@ -516,7 +516,7 @@ class FreshRSS_importExport_Controller extends FreshRSS_ActionController {
|
||||
}
|
||||
|
||||
$feed_id = $article_to_feed[$item['guid']];
|
||||
$author = is_string($item['author'] ?? null) ? Minz_Helper::htmlspecialchars_utf8($item['author']) : '';
|
||||
$author = is_string($item['author'] ?? null) ? Minz_Helper::htmlspecialchars_utf8(htmlspecialchars_decode($item['author'], ENT_QUOTES)) : '';
|
||||
$is_starred = null; // null is used to preserve the current state if that item exists and is already starred
|
||||
$is_read = null;
|
||||
$tags = is_array($item['categories'] ?? null) ? $item['categories'] : [];
|
||||
@@ -560,7 +560,7 @@ class FreshRSS_importExport_Controller extends FreshRSS_ActionController {
|
||||
$url = Minz_Helper::htmlspecialchars_utf8(FreshRSS_http_Util::checkUrl($url) ?: '');
|
||||
|
||||
$title = is_string($item['title'] ?? null) ? $item['title'] : $url;
|
||||
$title = Minz_Helper::htmlspecialchars_utf8($title);
|
||||
$title = Minz_Helper::htmlspecialchars_utf8(htmlspecialchars_decode($title, ENT_QUOTES));
|
||||
|
||||
if (is_array($item['content'] ?? null) && is_string($item['content']['content'] ?? null)) {
|
||||
$content = $item['content']['content'];
|
||||
|
||||
Reference in new issue
Block a user