Language Resource Files unescaping "&"
See original GitHub issueDescription
The issue is due to the ampersands being unescaped which results in an invalid entity for the XML. For example in DNN 9.1.1 if one wants to use
in a resource file, one would need to go  
which stores without errors; however, in 9.2 Due to the change to use HTML Entities (one of the latest PR for this feature), it ends up unescaping the ampersand which results in
and either the files doesn’t save or it breaks.
Steps to reproduce
- Go to
Settings > Site Settings > Languages
, and the resource files for one of the languages (en-US) - From the file drop-down select the GlobalResources file, see screenshot.
- Make a small value change and attempt to save the file.
Current result
The file will not save and you will receive a 500
Expected result
The file should save the changes without issues.
Affected version
- 9.2
- 9.1.1
- 9.1
- 9.0
Issue Analytics
- State:
- Created 5 years ago
- Comments:19 (19 by maintainers)
Top Results From Across the Web
Cleaning Stuck on Language Resource Files
After the first scan, check the box to have it include System Files. Restart PC, try the Storage cleanup again. If problems persist...
Read more >RESX
If you are applying processing directives to a RESX file, the directive ... all html4 entities are unescaped, except the basic set: <...
Read more >Special XML characters (and how to avoid &amp;)
Someone receiving such information must "un-escape" the & to & – otherwise, if he ingests the name as is into his database and...
Read more >& in XLIFF does not get unescaped · Issue #3081 · ...
Our use case is that we use XLIFF files exported from Unity's localization package. In Unity, strings use Rich Text to determine if...
Read more >Double escaping or unescaping - CodeQL - GitHub
Escaping meta-characters in untrusted input is an important technique for preventing injection attacks such as cross-site scripting.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think the actual issue here is using
InnerXml
. I think that instead we should useInnerText
or aCDATA
node to have the XML library ensure values get properly escaped.See this SO question for reference: https://stackoverflow.com/questions/4679543/how-to-write-cdata-in-xml
cc @Mohtshum
Done @bdukes