Skip to content

Commit

Permalink
Fix bug with encoding.
Browse files Browse the repository at this point in the history
  • Loading branch information
roncli committed Apr 6, 2021
1 parent b82a35d commit 1455165
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion public/js/common.js
Expand Up @@ -75,7 +75,7 @@ class Common {
* @returns {string} The encoded string.
*/
static htmlEncode(str) {
return str.replace(/</gim, "&lt;").replace(/[\u0080-\uFFFF<>&]/gim, (i) => `&#${i.charCodeAt(0)};`);
return str.replace(/&/gim, "&gt;").replace(/</gim, "&lt;").replace(/[\u0080-\uFFFF]/gim, (i) => `&#${i.charCodeAt(0)};`);
}

// ## # ### # ### # ### ## #
Expand Down

0 comments on commit 1455165

Please sign in to comment.