Completely remove variableSubstitution(), because magic variable
authorWil Mahan <wmahan@users.mediawiki.org>
Tue, 21 Sep 2004 05:12:44 +0000 (05:12 +0000)
committerWil Mahan <wmahan@users.mediawiki.org>
Tue, 21 Sep 2004 05:12:44 +0000 (05:12 +0000)
replacement is redundantly done in braceSubstitution(). Aside
from removing unnecessary code, this will make it easier to fix
bug 89, parameters to {{subst:}} templates

includes/Parser.php

index 48f4496..fae9afc 100644 (file)
@@ -1434,11 +1434,6 @@ class Parser
                # PHP global rebinding syntax is a bit weird, need to use the GLOBALS array
                $GLOBALS['wgCurParser'] =& $this;
 
-               if ( $this->mOutputType == OT_HTML || $this->mOutputType == OT_MSG ) {
-                       # Variable substitution
-                       $text = preg_replace_callback( "/{{([$titleChars]*?)}}/", 'wfVariableSubstitution', $text );
-               }
-               
                if ( $this->mOutputType == OT_HTML ) {
                        # Argument substitution
                        $text = preg_replace_callback( "/{{{([$titleChars]*?)}}}/", 'wfArgSubstitution', $text );
@@ -1453,19 +1448,6 @@ class Parser
                return $text;
        }
 
-       function variableSubstitution( $matches ) {
-               if ( !$this->mVariables ) {
-                       $this->initialiseVariables();
-               }
-               if ( array_key_exists( $matches[1], $this->mVariables ) ) {
-                       $text = $this->mVariables[$matches[1]];
-                       $this->mOutput->mContainsOldMagic = true;
-               } else {
-                       $text = $matches[0];
-               }
-               return $text;
-       }
-
        # Split template arguments
        function getTemplateArgs( $argsString ) {
                if ( $argsString === '' ) {
@@ -2558,11 +2540,6 @@ function wfArgSubstitution( $matches ) {
        return $wgCurParser->argSubstitution( $matches );
 }
 
-function wfVariableSubstitution( $matches ) {
-       global $wgCurParser;
-       return $wgCurParser->variableSubstitution( $matches );
-}
-
 /**
  * Return the total number of articles
  */