Fixed spacing in files direct in includes folder
[lhc/web/wiklou.git] / includes / MagicWord.php
index 257a46d..18b79c4 100644 (file)
@@ -149,7 +149,7 @@ class MagicWord {
        );
 
        /* Array of caching hints for ParserCache */
-       static public $mCacheTTLs = array (
+       static public $mCacheTTLs = array(
                'currentmonth' => 86400,
                'currentmonth1' => 86400,
                'currentmonthname' => 86400,
@@ -309,6 +309,7 @@ class MagicWord {
                $wgContLang->getMagic( $this );
                if ( !$this->mSynonyms ) {
                        $this->mSynonyms = array( 'dkjsagfjsgashfajsh' );
+                       wfProfileOut( __METHOD__ );
                        throw new MWException( "Error: invalid magic word '$id'" );
                        #wfDebugLog( 'exception', "Error: invalid magic word '$id'\n" );
                }
@@ -326,9 +327,10 @@ class MagicWord {
                usort( $synonyms, array( $this, 'compareStringLength' ) );
 
                $escSyn = array();
-               foreach ( $synonyms as $synonym )
+               foreach ( $synonyms as $synonym ) {
                        // In case a magic word contains /, like that's going to happen;)
                        $escSyn[] = preg_quote( $synonym, '/' );
+               }
                $this->mBaseRegex = implode( '|', $escSyn );
 
                $case = $this->mCaseSensitive ? '' : 'iu';
@@ -381,8 +383,9 @@ class MagicWord {
         * @return string
         */
        function getRegexCase() {
-               if ( $this->mRegex === '' )
+               if ( $this->mRegex === '' ) {
                        $this->initRegex();
+               }
 
                return $this->mCaseSensitive ? '' : 'iu';
        }
@@ -464,7 +467,6 @@ class MagicWord {
                }
        }
 
-
        /**
         * Returns true if the text matches the word, and alters the
         * input string, removing all instances of the word
@@ -598,7 +600,7 @@ class MagicWord {
        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;