From: Alexander Ebert Date: Mon, 27 Sep 2021 15:00:48 +0000 (+0200) Subject: Incorrect detection of HTML tags X-Git-Tag: 5.4.9_dev_1~63^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=355a15a6d0c1e7bfc0ee93cab96d10e7f560bfb8;p=GitHub%2FWoltLab%2FWCF.git Incorrect detection of HTML tags The previous regex was incorrect and caused false-positive matches. One such case was a `The …` which translated into `###td ###The …`, causing it to be recognized as a ``. The new regex is much more restrictive by requiring at least one whitespace after the tag name if there is additional content. --- diff --git a/wcfsetup/install/files/js/3rdParty/redactor2/redactor.js b/wcfsetup/install/files/js/3rdParty/redactor2/redactor.js index 0a6091a785..e8fff4caf8 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor2/redactor.js +++ b/wcfsetup/install/files/js/3rdParty/redactor2/redactor.js @@ -2888,7 +2888,7 @@ for (var i = 0; i < len; i++) { if (tags[i] === 'td' || tags[i] === 'th') { html = html.replace( - new RegExp('###' + tags[i] + '\s?(.*?[^#])###', 'gi'), + new RegExp('###' + tags[i] + '(?:\\s?|\\s([^#]*?))###', 'gi'), '<' + tags[i] + '$1>' ); }