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

Web interface translates special characters into ' notation #3319

Open
schuettecarsten opened this issue Mar 12, 2025 · 2 comments
Open

Comments

@schuettecarsten
Copy link

When using special characters like ' or german Umlauts in the Comment fields in Web UI, these characters are translated into HTML notation like ' whenever you edit an existing line. Items are added correctly but comments get broken when you edit the lines.

Example:
Image

Versions:

Core
    Version is 3f5c009 (Latest: null)
    Branch is development
    Hash is 3f5c0091 (Latest: 3f5c0091)
Web
    Version is ffdffbc (Latest: null)
    Branch is development
    Hash is ffdffbc2 (Latest: ffdffbc2)
FTL
    Version is vDev-27bea5b (Latest: null)
    Branch is development
    Hash is 27bea5b0 (Latest: 27bea5b0)
@DL6ER DL6ER transferred this issue from pi-hole/FTL Mar 12, 2025
@rdwebdesign
Copy link
Member

rdwebdesign commented Mar 12, 2025

When using special characters like ' or german Umlauts ...

Are you sure other characters are replaced?

(Did you use Ä or Ü in the typed text?)

I can replicate only the apostrophe (') issue, but the other characters I tested (like accented letters and umlauts) are not changed.


The apostrophe/quotes issue is happening because we are using the escapeHtml() function every time the field is edited.
This function replaces ' with the HTML entity '.
It also replaces & with &. This is causing double (triple and so on...) encoding:

' -> ' -> ' -> ' -> '

The multiple encoding issue only happens with &, ', ", < and >. No other characters will be replaced by this function.

@schuettecarsten
Copy link
Author

I first saw it on the apostrophe, that's correct and after some changes, I also saw that the whole text was broken.
This might be caused by the multiple encodings of the & and not by the umlaut itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants