Parentheses needed for this regex for correct treatment of alternatives.
authorJens Frank <jeluf@users.mediawiki.org>
Mon, 6 Sep 2004 20:36:35 +0000 (20:36 +0000)
committerJens Frank <jeluf@users.mediawiki.org>
Mon, 6 Sep 2004 20:36:35 +0000 (20:36 +0000)
 ^(#REDIRECT|#UMLEITUNG) instead of ^#REDIRECT|#UMLEITUNG, where the anchor would only be used for #REDIRECT
Bug reported by borislav for Bulgarian deletion log page

includes/MagicWord.php

index a41445b..0508f96 100644 (file)
@@ -131,7 +131,7 @@ class MagicWord {
                $this->mBaseRegex = implode( '|', $escSyn );
                $case = $this->mCaseSensitive ? '' : 'i';
                $this->mRegex = "/{$this->mBaseRegex}/{$case}";
-               $this->mRegexStart = "/^{$this->mBaseRegex}/{$case}";
+               $this->mRegexStart = "/^({$this->mBaseRegex})/{$case}";
                $this->mVariableRegex = str_replace( "\\$1", "([$variableClass]*?)", $this->mRegex );
                $this->mVariableStartToEndRegex = str_replace( "\\$1", "([$variableClass]*?)", 
                        "/^({$this->mBaseRegex})$/{$case}" );