From: Alexander Ebert Date: Mon, 1 Jun 2015 23:44:31 +0000 (+0200) Subject: Fixed an issue with U+200C/U+200D X-Git-Tag: 2.1.5~36 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=eaa0f9b065f0f61e8c4910a384f199ecb775199e;p=GitHub%2FWoltLab%2FWCF.git Fixed an issue with U+200C/U+200D --- diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js index 4cbfcc7110..8ad7b8ef20 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js @@ -44,6 +44,9 @@ RedactorPlugins.wbbcode = function() { var $mpCleanOnSync = this.clean.onSync; this.clean.onSync = (function(html) { + html = html.replace(/\u200C/g, '__wcf_zwnj__'); + html = html.replace(/\u200D/g, '__wcf_zwj__'); + if ($skipOnSyncReplacementOnce === true) { $skipOnSyncReplacementOnce = false; } @@ -51,7 +54,10 @@ RedactorPlugins.wbbcode = function() { html = html.replace(/

]+)?><\/p>/g, '

@@@wcf_empty_line@@@

'); } - return $mpCleanOnSync.call(this, html); + html = $mpCleanOnSync.call(this, html); + + html = html.replace(/__wcf_zwnj__/g, '\u200C'); + return html.replace(/__wcf_zwj__/g, '\u200D'); }).bind(this); if (this.wutil.getOption('woltlab.autosaveOnce')) { diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js index 70ccdf695a..d0cd2e9aaf 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js @@ -417,6 +417,18 @@ RedactorPlugins.wmonkeypatch = function() { return html.replace(/$/i, ''); }; + // clean.removeSpaces + var mpRemoveSpaces = this.clean.removeSpaces; + this.clean.removeSpaces = (function(html) { + html = html.replace(/\u200C/g, '__wcf_zwnj__'); + html = html.replace(/\u200D/g, '__wcf_zwj__'); + + html = mpRemoveSpaces.call(this, html); + + html = html.replace(/__wcf_zwnj__/g, '\u200C'); + return html.replace(/__wcf_zwj__/g, '\u200D'); + }); + // clean.onSet var $mpOnSet = this.clean.onSet; this.clean.onSet = (function(html) {