Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable23] Fix HTML entities not decoded in comment just added #35102

Conversation

danxuliu
Copy link
Member

Backport of #35054

@danxuliu danxuliu added this to the Nextcloud 23.0.12 milestone Nov 11, 2022
@danxuliu danxuliu changed the title [sable23] Fix HTML entities not decoded in comment just added [stable23] Fix HTML entities not decoded in comment just added Nov 11, 2022
This will make possible to use it from files other than
"GetComments.js".

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
The XML data received from the comments endpoint has an inconsistent
encoding; some entities are encoded once and others are encoded twice.
When the comment list is loaded the comments are fetched using
GetComments, which handles all that, and therefore shows the messages
and author names as expected.

However, when a new comment is posted the list is not got again; instead
the new comment is loaded from the comment data returned after posting
it. This is done in NewComment, which did not decode the messages nor
the author names, and therefore showed, for example, "&amp;" instead of
"&".

To solve that now the same decoding logic used in GetComments is applied
too in NewComment.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
@danxuliu danxuliu force-pushed the backport/35054/stable23-fix-html-entities-not-decoded-in-comment-just-added branch from 3f102d4 to 6091070 Compare November 11, 2022 11:31
@danxuliu
Copy link
Member Author

/compile /

Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
@danxuliu danxuliu marked this pull request as ready for review November 11, 2022 11:47
@danxuliu danxuliu requested review from Pytal and szaimen November 11, 2022 11:48
Copy link
Contributor

@szaimen szaimen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐘

@blizzz blizzz mentioned this pull request Nov 21, 2022
8 tasks
@szaimen szaimen merged commit 799838a into stable23 Nov 23, 2022
@szaimen szaimen deleted the backport/35054/stable23-fix-html-entities-not-decoded-in-comment-just-added branch November 23, 2022 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants