Skip to content

fix: do not double-encode titles and authors when importing JSON - #9556

Merged
Alkarex merged 4 commits into
FreshRSS:edgefrom
jayhemnani9910:fix/import-json-title-double-escape
Nov 12, 2026
Merged

Alkarex merged 4 commits into
FreshRSS:edgefrom
jayhemnani9910:fix/import-json-title-double-escape

Conversation

@jayhemnani9910

Copy link
Copy Markdown
Contributor

Restoring a FreshRSS ZIP export (or importing its starred JSON) double-encodes every article title and author that contains &, <, > or quotes:

before export:  Post 1 &amp; more   | Tom &amp; Jerry
after restore:  Post 1 &amp;amp; more | Tom &amp;amp; Jerry

The UI then shows "Post 1 & more", and each further export/import cycle adds another layer.

Titles and authors are stored HTML-encoded and exported that way (Entry::toGReader()), and since #9168 importJson() encodes them again. They are now decoded before being encoded, so FreshRSS's own exports come back unchanged and plain-text titles from other readers are still escaped as #9168 intended.

Tested with freshrss/freshrss:edge (1.30.5-dev): actualize a feed with & in titles and authors, cli/export-zip-for-user.php, cli/import-for-user.php into a new user. Before: &amp;amp;; after: identical to the original, with read, starred and labels still restored. 1.30.4 has the same bug. php -l passes; PHPUnit/PHPStan not run.

FreshRSS exports titles and authors HTML-encoded, and the JSON import
encoded them again since FreshRSS#9168, so restoring a ZIP export turned
"Post &amp; more" into "Post &amp;amp; more". Decode before encoding.
@Alkarex Alkarex added this to the 1.31.0 milestone Nov 12, 2026
@Alkarex Alkarex added the Bug (unconfirmed) issues that could not be reproduced yet label Nov 12, 2026
@Alkarex
Alkarex merged commit 2ce6f11 into FreshRSS:edge Nov 12, 2026
4 checks passed
@Alkarex

Alkarex commented Nov 12, 2026

Copy link
Copy Markdown
Member

@Alkarex Alkarex added Bug (confirmed) 🐞 issues that are reproducible and removed Bug (unconfirmed) issues that could not be reproduced yet labels Nov 12, 2026
@jayhemnani9910
jayhemnani9910 deleted the fix/import-json-title-double-escape branch November 13, 2026 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug (confirmed) 🐞 issues that are reproducible

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants