From: Tim Düsterhus Date: Tue, 18 Apr 2023 07:42:25 +0000 (+0200) Subject: Fix `StringUtil.unescapeHTML()` X-Git-Tag: 5.3.28~3^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ed5f5cbd3fd046920f927eba6a13d35541f5dc75;p=GitHub%2FWoltLab%2FWCF.git Fix `StringUtil.unescapeHTML()` The HTML was unescaped in an incorrect order, causing incorrect results for inputs like: StringUtil.unescapeHTML('&quot;') --- diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/StringUtil.js b/wcfsetup/install/files/js/WoltLabSuite/Core/StringUtil.js index 094aca18e7..37f4754e71 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/StringUtil.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/StringUtil.js @@ -98,7 +98,7 @@ define(['Language', './NumberUtil'], function(Language, NumberUtil) { * @return {String} */ unescapeHTML: function(string) { - return String(string).replace(/&/g, '&').replace(/"/g, '"').replace(/</g, '<').replace(/>/g, '>'); + return String(string).replace(/"/g, '"').replace(/</g, '<').replace(/>/g, '>').replace(/&/g, '&'); }, /**