question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Language Resource Files unescaping "&"

See original GitHub issue

Description

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

  1. Go to Settings > Site Settings > Languages, and the resource files for one of the languages (en-US)
  2. From the file drop-down select the GlobalResources file, see screenshot.
  3. 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:closed
  • Created 5 years ago
  • Comments:19 (19 by maintainers)

github_iconTop GitHub Comments

1reaction
tpluscodecommented, Jul 4, 2018

I think the actual issue here is using InnerXml. I think that instead we should use InnerText or a CDATA 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

0reactions
tpluscodecommented, Jul 10, 2018

Done @bdukes

Read more comments on GitHub >

github_iconTop 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;amp;)
Someone receiving such information must "un-escape" the & to & – otherwise, if he ingests the name as is into his database and...
Read more >
&amp; 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found