From: Jens Frank Date: Mon, 6 Sep 2004 20:36:35 +0000 (+0000) Subject: Parentheses needed for this regex for correct treatment of alternatives. X-Git-Tag: 1.5.0alpha1~2076 X-Git-Url: http://git.cyclocoop.org/%24self?a=commitdiff_plain;h=45134645f88a4aba3c9b4fb1759078b50631d74a;p=lhc%2Fweb%2Fwiklou.git Parentheses needed for this regex for correct treatment of alternatives. ^(#REDIRECT|#UMLEITUNG) instead of ^#REDIRECT|#UMLEITUNG, where the anchor would only be used for #REDIRECT Bug reported by borislav for Bulgarian deletion log page --- diff --git a/includes/MagicWord.php b/includes/MagicWord.php index a41445b0ba..0508f96155 100644 --- a/includes/MagicWord.php +++ b/includes/MagicWord.php @@ -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}" );