From: Alexander Ebert Date: Wed, 5 Oct 2016 10:53:08 +0000 (+0200) Subject: Fixed encoded ampersands being replaced X-Git-Tag: 3.0.0_Beta_3~50^2~90 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0a3f08d1f157b3754ebb0a13c0e1d85d11d45197;p=GitHub%2FWoltLab%2FWCF.git Fixed encoded ampersands being replaced --- diff --git a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabClean.js b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabClean.js index 233f8bf4e1..63a367fe17 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabClean.js +++ b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabClean.js @@ -9,7 +9,17 @@ $.Redactor.prototype.WoltLabClean = function() { var mpOnSet = this.clean.onSet; this.clean.onSet = (function (html) { - return mpOnSet.call(this, html.replace(/\u200B/g, '')); + html = html.replace(/\u200B/g, ''); + + // fix ampersands being replaced + html = html.replace(/&/g, '@@@WCF_AMPERSAND@@@'); + + html = mpOnSet.call(this, html); + + // restore ampersands + html = html.replace(/@@@WCF_AMPERSAND@@@/g, '&'); + + return html; }).bind(this); var mpOnSync = this.clean.onSync; @@ -17,6 +27,9 @@ $.Redactor.prototype.WoltLabClean = function() { var div = elCreate('div'); var replacements = {}; + // fix ampersands being replaced + html = html.replace(/&/g, '@@@WCF_AMPERSAND@@@'); + if (html.indexOf('