From: Alexander Ebert Date: Sat, 20 Jun 2015 15:03:13 +0000 (+0200) Subject: Fixed regex for quotes being too greedy X-Git-Tag: 2.1.5~17^2~4 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f705c76cc568dfd6d3e1bdd079fcc4b5e68cf4d3;p=GitHub%2FWoltLab%2FWCF.git Fixed regex for quotes being too greedy --- diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js index 2741e23ed0..ee446b238a 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js @@ -915,7 +915,7 @@ RedactorPlugins.wbbcode = function() { data = data.replace(/\[sup\]([\s\S]*?)\[\/sup]/gi, (function(match, content) { return this.wbbcode._expandFormatting(content, '', ''); }).bind(this)); - + // [img] data = data.replace(/\[img\]([^"]+?)\[\/img\]/gi,''); data = data.replace(/\[img='?([^"]*?)'?,'?(left|right)'?\]\[\/img\]/gi, function(match, src, alignment) { @@ -1247,7 +1247,7 @@ RedactorPlugins.wbbcode = function() { var self = this; var $transformQuote = function(quote) { - return quote.replace(/\[quote(=['"].+['"])?\]([\S\s]*)\[\/quote\]/gi, function(match, attributes, innerContent) { + return quote.replace(/\[quote(=['"].+?\1)?\]([\S\s]*)\[\/quote\]/gi, function(match, attributes, innerContent) { var $author = ''; var $link = '';