Skip to content

Fix HTML entity rendering in file comments sidebar - #29029

Merged
CarlSchwan merged 1 commit into
masterfrom
fix/28243/render-html-entities
Nov 8, 2021
Merged

Fix HTML entity rendering in file comments sidebar#29029
CarlSchwan merged 1 commit into
masterfrom
fix/28243/render-html-entities

Conversation

@Pytal

@PytalPytal commented Oct 1, 2021

Copy link
Copy Markdown
Member

Fix#28243

This fix decodes HTML entities contained in comment messages and displaynames.

Some characters are double-encoded, e.g. > - >, so we decode the strings twice. Full character to encoded version map:

  • > - > double-encoded
  • < - &amp;lt; double-encoded
  • & - &amp; encoded
  • " - &quot; encoded
  • ' - ' not encoded

Further work

Update backend XML encoder logic to address inconsistent encoding #29306

@PytalPytal added bug 3. to review Waiting for reviews labels Oct 1, 2021
@PytalPytal added this to the Nextcloud 23 milestone Oct 1, 2021
@Pytal
Pytal requested review from a team and PVince81October 1, 2021 22:38
@PytalPytal self-assigned this Oct 1, 2021
@Pytal
Pytal requested review from artonge and szaimen and removed request for a teamOctober 1, 2021 22:38
@Pytal

This comment has been minimized.

@Pytal

Pytal commented Oct 1, 2021

Copy link
Copy Markdown
MemberAuthor

/backport to stable22

@Pytal

Pytal commented Oct 1, 2021

Copy link
Copy Markdown
MemberAuthor

/backport to stable21

Comment threadapps/comments/src/components/Comment.vue Outdated
@Pytal
Pytalforce-pushed the fix/28243/render-html-entities branch from b81f217 to 110190bCompareOctober 4, 2021 21:14
@PytalPytal changed the title Fix HTML entity rendering in file commentsFix HTML entity rendering in file comments sidebarOct 4, 2021
@Pytal

This comment has been minimized.

@nextcloud-command
nextcloud-commandforce-pushed the fix/28243/render-html-entities branch from 110190b to 347b27cCompareOctober 4, 2021 21:35
Comment threadapps/comments/src/services/GetComments.js
@skjnldsvskjnldsv mentioned this pull request Oct 13, 2021

@PVince81PVince81 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍

@PVince81

This comment has been minimized.

@Pytal
Pytalforce-pushed the fix/28243/render-html-entities branch from 347b27c to 09f8666CompareOctober 21, 2021 15:28
@Pytal

Copy link
Copy Markdown
MemberAuthor

@tobiasKaminsky do clients render these correctly?

@Pytal

This comment has been minimized.

@nextcloud-command
nextcloud-commandforce-pushed the fix/28243/render-html-entities branch from 09f8666 to f06f1d6CompareOctober 21, 2021 20:37
@Pytal
Pytalforce-pushed the fix/28243/render-html-entities branch from f06f1d6 to e6abd38CompareOctober 21, 2021 20:54
@Pytal

Copy link
Copy Markdown
MemberAuthor

/compile amend /

@nextcloud-command
nextcloud-commandforce-pushed the fix/28243/render-html-entities branch from e6abd38 to f332ba2CompareOctober 21, 2021 21:15
@tobiasKaminsky

Copy link
Copy Markdown
Member

@tobiasKaminsky do clients render these correctly?

As far as I know this was only a problem on web ui side.

@skjnldsvskjnldsv mentioned this pull request Oct 25, 2021
25 tasks
@skjnldsv

Copy link
Copy Markdown
Member

As far as I know this was only a problem on web ui side.

It seems the server returns double-encoding data, can you coordinate with @Pytal and @PVince81 to make sure @tobiasKaminsky ? :)

@skjnldsvskjnldsv mentioned this pull request Nov 1, 2021
19 tasks
@tobiasKaminsky

Copy link
Copy Markdown
Member

Android:

  • input on Android: works
  • input on Server: we just show activity feed per file, so we show what server renders -> Android not affected

Desktop:

  • does not have comment function
  • only shows comments via activity stream

iOS:

  • could not test this PR
  • 22.0.0 is working correctly, so if you do not change anything on backend logic, but only how comments are displayed, it should be fine.

@blizzzblizzz mentioned this pull request Nov 3, 2021
18 tasks
@skjnldsvskjnldsv mentioned this pull request Nov 8, 2021
23 tasks

@CarlSchwanCarlSchwan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me, I will rebase it

@CarlSchwan
CarlSchwanforce-pushed the fix/28243/render-html-entities branch 2 times, most recently from b34dd35 to ce614eaCompareNovember 8, 2021 17:02
Signed-off-by: Christopher Ng <chrng8@gmail.com>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
@CarlSchwan
CarlSchwanforce-pushed the fix/28243/render-html-entities branch from ce614ea to e5873a2CompareNovember 8, 2021 21:21
@CarlSchwan
CarlSchwan merged commit d879299 into masterNov 8, 2021
@CarlSchwan
CarlSchwan deleted the fix/28243/render-html-entities branch November 8, 2021 22:51
@PytalPytal added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Nov 22, 2021
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4. to releaseReady to be released and/or waiting for tests to finishbug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Quotation marks get html escape in file comments

5 participants

@Pytal@PVince81@tobiasKaminsky@skjnldsv@CarlSchwan