From 536b796ee1e1be466db1767fc64d8f027f3a5328 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Sun, 25 Jan 2004 02:38:47 +0000 Subject: [PATCH] More characters allowed in message names (or more generally, MagicWord "variables") --- includes/MagicWord.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/MagicWord.php b/includes/MagicWord.php index c8af12b0d2..3a274cd5ac 100644 --- a/includes/MagicWord.php +++ b/includes/MagicWord.php @@ -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 -- 2.20.1