From: Alexander Ebert Date: Wed, 20 Jul 2016 14:01:36 +0000 (+0200) Subject: Mention parser was not case-insensitive X-Git-Tag: 3.0.0_Beta_1~1029 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=fa0169b55bc13d78c935e75a004a5a1d620c1267;p=GitHub%2FWoltLab%2FWCF.git Mention parser was not case-insensitive --- diff --git a/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeTextParser.class.php b/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeTextParser.class.php index 0dd50488ad..80a3e80ce2 100644 --- a/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeTextParser.class.php +++ b/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeTextParser.class.php @@ -283,12 +283,12 @@ class HtmlInputNodeTextParser { foreach ($users as $userID => $username) { do { $needle = '@' . $username; - $pos = mb_strpos($value, $needle); + $pos = mb_stripos($value, $needle); // username not found, maybe it is quoted if ($pos === false) { - $needle = "@'" . str_replace("'", "''", $username) . "'"; - $pos = mb_strpos($value, $needle); + $needle = "@'" . str_ireplace("'", "''", $username) . "'"; + $pos = mb_stripos($value, $needle); } if ($pos !== false) { @@ -301,7 +301,7 @@ class HtmlInputNodeTextParser { // we use preg_replace() because the username could appear multiple times // and we need to replace them one by one, also avoiding only replacing // the non-quoted username even though both variants are present - $value = preg_replace('~' . preg_quote($needle, '~') . '~', $marker, $value, 1); + $value = preg_replace('~' . preg_quote($needle, '~') . '~i', $marker, $value, 1); } } while ($pos);