Browse Source

&amp; should be reversed last (to correctly transform "&amp;lt;" to "&lt;" and not to "<")

master
Denis Ryabov 10 years ago
parent
commit
cd06996b62
  1. 4
      js/twister_formatpost.js

4
js/twister_formatpost.js

@ -342,10 +342,10 @@ function escapeHtmlEntities(str) {
function reverseHtmlEntities(str) { function reverseHtmlEntities(str) {
return str return str
.replace(/&amp;/g, '&')
.replace(/&lt;/g, '<') .replace(/&lt;/g, '<')
.replace(/&gt;/g, '>') .replace(/&gt;/g, '>')
.replace(/&quot;/g, '"') .replace(/&quot;/g, '"')
.replace(/&apos;/g, "'"); .replace(/&apos;/g, "'")
.replace(/&amp;/g, '&');
} }

Loading…
Cancel
Save