-
Notifications
You must be signed in to change notification settings - Fork 96
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
Toast and escape characters in utf8 #1639
Labels
Comments
WIP Using this works for the single quote function decodeEntities(encodedString) {
var textArea = document.createElement('textarea');
textArea.innerHTML = encodedString;
return textArea.value;
} but doesn't help with ö so there is more to it that it seems |
lekoala
added a commit
to lekoala/silverstripe-admin
that referenced
this issue
Dec 21, 2023
Fixes silverstripe#1639 Side bonus : this is much safer than using jquery
Two pr to fix this |
GuySartorelli
added
type/bug
impact/medium
affects/v5
impact/low
and removed
impact/medium
labels
Dec 21, 2023
This was referenced Jan 15, 2024
This is mostly fixed now - but |
This was referenced Feb 15, 2024
All PRs now merged. Anything that hasn't yet been tagged will be automagically tagged by GitHub Actions. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Module version(s) affected
2.1.5
Description
This is related to silverstripe/silverstripe-framework#11089
Currently, toast messages are escaped using Convert::raw2xml. This means that characters like ' are escaped to their utf8 equivalent (eg: X-Status: Saved Viewing "test event's ...)
But the js itself doesn't do anything to display this properly
See here the status message handler
silverstripe-admin/client/src/legacy/LeftAndMain.js
Lines 1511 to 1514 in ef1385a
On top of that, the method used to escape the characters (that should already be safe, but still) is not optimal (see https://stackoverflow.com/questions/1147359/how-to-decode-html-entities-using-jquery/) since adding this in a div could still execute malicious code. Ideally, that should be a standard way to escape strings across the framework without having custom bits of code like this.
How to reproduce
Possible Solution
No response
Additional Context
No response
Validations
silverstripe/installer
(with any code examples you've provided)PRs
The text was updated successfully, but these errors were encountered: