Mention parser was not case-insensitive
authorAlexander Ebert <ebert@woltlab.com>
Wed, 20 Jul 2016 14:01:36 +0000 (16:01 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 20 Jul 2016 14:02:07 +0000 (16:02 +0200)
wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeTextParser.class.php

index 0dd50488ade8e3376d837bcde0e487ac75a90940..80a3e80ce21bdffc68f4fc09be5b9cbaf707ee44 100644 (file)
@@ -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);