From 08aa4418c30cfc18ccc69a0f0f9cb9e17be6c196 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Mon, 12 Aug 2013 09:28:15 +0200 Subject: Update to MediaWiki 1.21.1 --- includes/MagicWord.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'includes/MagicWord.php') diff --git a/includes/MagicWord.php b/includes/MagicWord.php index 42791f57..7b669249 100644 --- a/includes/MagicWord.php +++ b/includes/MagicWord.php @@ -217,7 +217,7 @@ class MagicWord { /**#@-*/ - function __construct($id = 0, $syn = array(), $cs = false) { + function __construct( $id = 0, $syn = array(), $cs = false ) { $this->mId = $id; $this->mSynonyms = (array)$syn; $this->mCaseSensitive = $cs; @@ -282,6 +282,7 @@ class MagicWord { */ static function getDoubleUnderscoreArray() { if ( is_null( self::$mDoubleUnderscoreArray ) ) { + wfRunHooks( 'GetDoubleUnderscoreIDs', array( &self::$mDoubleUnderscoreIDs ) ); self::$mDoubleUnderscoreArray = new MagicWordArray( self::$mDoubleUnderscoreIDs ); } return self::$mDoubleUnderscoreArray; @@ -366,7 +367,7 @@ class MagicWord { * @return string */ function getRegex() { - if ($this->mRegex == '' ) { + if ( $this->mRegex == '' ) { $this->initRegex(); } return $this->mRegex; @@ -392,7 +393,7 @@ class MagicWord { * @return string */ function getRegexStart() { - if ($this->mRegex == '' ) { + if ( $this->mRegex == '' ) { $this->initRegex(); } return $this->mRegexStart; @@ -404,7 +405,7 @@ class MagicWord { * @return string */ function getBaseRegex() { - if ($this->mRegex == '') { + if ( $this->mRegex == '' ) { $this->initRegex(); } return $this->mBaseRegex; @@ -453,9 +454,9 @@ class MagicWord { # blank elements and re-sort the indices. # See also bug 6526 - $matches = array_values(array_filter($matches)); + $matches = array_values( array_filter( $matches ) ); - if ( count($matches) == 1 ) { + if ( count( $matches ) == 1 ) { return $matches[0]; } else { return $matches[1]; @@ -463,7 +464,6 @@ class MagicWord { } } - /** * Returns true if the text matches the word, and alters the * input string, removing all instances of the word @@ -534,7 +534,7 @@ class MagicWord { * * @return string */ - function getVariableRegex() { + function getVariableRegex() { if ( $this->mVariableRegex == '' ) { $this->initRegex(); } @@ -577,7 +577,7 @@ class MagicWord { * * @return bool */ - function getWasModified(){ + function getWasModified() { return $this->mModified; } @@ -594,10 +594,10 @@ class MagicWord { * * @return bool */ - function replaceMultiple( $magicarr, $subject, &$result ){ + function replaceMultiple( $magicarr, $subject, &$result ) { $search = array(); $replace = array(); - foreach( $magicarr as $id => $replacement ){ + foreach( $magicarr as $id => $replacement ) { $mw = MagicWord::get( $id ); $search[] = $mw->getRegex(); $replace[] = $replacement; @@ -617,7 +617,7 @@ class MagicWord { function addToArray( &$array, $value ) { global $wgContLang; foreach ( $this->mSynonyms as $syn ) { - $array[$wgContLang->lc($syn)] = $value; + $array[$wgContLang->lc( $syn )] = $value; } } @@ -811,7 +811,7 @@ class MagicWordArray { return array( $magicName, $paramValue ); } // This shouldn't happen either - throw new MWException( __METHOD__.': parameter not found' ); + throw new MWException( __METHOD__ . ': parameter not found' ); } /** -- cgit v1.2.2