From: Marcel Werk Date: Sun, 21 Jun 2015 22:55:18 +0000 (+0200) Subject: Fixed quote bbcode issue X-Git-Tag: 2.1.5~18 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=bb5cf86a6d9bc59af39b2f167a35963786f38e55;p=GitHub%2FWoltLab%2FWCF.git Fixed quote bbcode issue --- diff --git a/wcfsetup/install/files/lib/system/bbcode/QuoteBBCode.class.php b/wcfsetup/install/files/lib/system/bbcode/QuoteBBCode.class.php index df7f8f2696..6c5ed06608 100644 --- a/wcfsetup/install/files/lib/system/bbcode/QuoteBBCode.class.php +++ b/wcfsetup/install/files/lib/system/bbcode/QuoteBBCode.class.php @@ -4,6 +4,7 @@ use wcf\system\application\ApplicationHandler; use wcf\system\message\embedded\object\MessageEmbeddedObjectManager; use wcf\system\request\RouteHandler; use wcf\system\WCF; +use wcf\util\StringUtil; /** * Parses the [quote] bbcode tag. @@ -29,7 +30,7 @@ class QuoteBBCode extends AbstractBBCode { $quoteAuthor = (!empty($openingTag['attributes'][0]) ? $openingTag['attributes'][0] : ''); $quoteAuthorObject = null; if ($quoteAuthor && !$externalQuoteLink) { - $quoteAuthorLC = mb_strtolower($quoteAuthor); + $quoteAuthorLC = mb_strtolower(StringUtil::decodeHTML($quoteAuthor)); foreach (MessageEmbeddedObjectManager::getInstance()->getObjects('com.woltlab.wcf.quote') as $user) { if (mb_strtolower($user->username) == $quoteAuthorLC) { $quoteAuthorObject = $user; diff --git a/wcfsetup/install/files/lib/system/message/embedded/object/AbstractMessageEmbeddedObjectHandler.class.php b/wcfsetup/install/files/lib/system/message/embedded/object/AbstractMessageEmbeddedObjectHandler.class.php index 6e53b5a398..71bd77daff 100644 --- a/wcfsetup/install/files/lib/system/message/embedded/object/AbstractMessageEmbeddedObjectHandler.class.php +++ b/wcfsetup/install/files/lib/system/message/embedded/object/AbstractMessageEmbeddedObjectHandler.class.php @@ -46,13 +46,22 @@ abstract class AbstractMessageEmbeddedObjectHandler extends DatabaseObjectDecora */ public static function getFirstParameters($message, $bbcode) { $pattern = '~\['.$bbcode.'= - (?:\'([^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\'|([^,\]]*)) + (\'(?:[^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\'|(?:[^,\]]*)) (?:,(?:\'[^\'\\\\]*(?:\\\\.[^\'\\\\]*)*\'|[^,\]]*))* \]~ix'; if (preg_match_all($pattern, $message, $matches)) { + foreach ($matches[1] as &$value) { + // remove quotes + if (mb_substr($value, 0, 1) == "'" && mb_substr($value, -1) == "'") { + $value = str_replace("\'", "'", $value); + $value = str_replace("\\\\", "\\", $value); + + $value = mb_substr($value, 1, -1); + } + } + $results = ArrayUtil::trim($matches[1]); - $results = array_merge($results, ArrayUtil::trim($matches[2])); $results = array_unique($results); return $results;