More characters allowed in message names (or more generally, MagicWord "variables")
authorTim Starling <tstarling@users.mediawiki.org>
Sun, 25 Jan 2004 02:38:47 +0000 (02:38 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Sun, 25 Jan 2004 02:38:47 +0000 (02:38 +0000)
includes/MagicWord.php

index c8af12b..3a274cd 100644 (file)
@@ -54,13 +54,15 @@ class MagicWord {
        # Preliminary initialisation
        /* private */ function initRegex()
        {
+               $variableClass = "A-Za-z0-9_\-\x80-\xff";
                $escSyn = array_map( "preg_quote", $this->mSynonyms );
                $this->mBaseRegex = implode( "|", $escSyn );
                $case = $this->mCaseSensitive ? "" : "i";
                $this->mRegex = "/{$this->mBaseRegex}/{$case}";
                $this->mRegexStart = "/^{$this->mBaseRegex}/{$case}";
-               $this->mVariableRegex = str_replace( "\\$1", "([A-Za-z0-9_\-]*)", $this->mRegex );
-               $this->mVariableStartToEndRegex = str_replace( "\\$1", "([A-Za-z0-9_\-]*)", "/^{$this->mBaseRegex}$/{$case}" );
+               $this->mVariableRegex = str_replace( "\\$1", "([$variableClass]*)", $this->mRegex );
+               $this->mVariableStartToEndRegex = str_replace( "\\$1", "([$variableClass]*)", 
+                       "/^{$this->mBaseRegex}$/{$case}" );
        }
        
        # Gets a regex representing matching the word