r5343 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r5342‎ | r5343 | r5344 >
Date:05:12, 21 September 2004
Author:wmahan
Status:old
Tags:
Comment:
Completely remove variableSubstitution(), because magic variable
replacement is redundantly done in braceSubstitution(). Aside
from removing unnecessary code, this will make it easier to fix
bug 89, parameters to {{subst:}} templates
Modified paths:
  • /trunk/phase3/includes/Parser.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Parser.php
@@ -1434,11 +1434,6 @@
14351435 # PHP global rebinding syntax is a bit weird, need to use the GLOBALS array
14361436 $GLOBALS['wgCurParser'] =& $this;
14371437
1438 - if ( $this->mOutputType == OT_HTML || $this->mOutputType == OT_MSG ) {
1439 - # Variable substitution
1440 - $text = preg_replace_callback( "/{{([$titleChars]*?)}}/", 'wfVariableSubstitution', $text );
1441 - }
1442 -
14431438 if ( $this->mOutputType == OT_HTML ) {
14441439 # Argument substitution
14451440 $text = preg_replace_callback( "/{{{([$titleChars]*?)}}}/", 'wfArgSubstitution', $text );
@@ -1453,19 +1448,6 @@
14541449 return $text;
14551450 }
14561451
1457 - function variableSubstitution( $matches ) {
1458 - if ( !$this->mVariables ) {
1459 - $this->initialiseVariables();
1460 - }
1461 - if ( array_key_exists( $matches[1], $this->mVariables ) ) {
1462 - $text = $this->mVariables[$matches[1]];
1463 - $this->mOutput->mContainsOldMagic = true;
1464 - } else {
1465 - $text = $matches[0];
1466 - }
1467 - return $text;
1468 - }
1469 -
14701452 # Split template arguments
14711453 function getTemplateArgs( $argsString ) {
14721454 if ( $argsString === '' ) {
@@ -2558,11 +2540,6 @@
25592541 return $wgCurParser->argSubstitution( $matches );
25602542 }
25612543
2562 -function wfVariableSubstitution( $matches ) {
2563 - global $wgCurParser;
2564 - return $wgCurParser->variableSubstitution( $matches );
2565 -}
2566 -
25672544 /**
25682545 * Return the total number of articles
25692546 */

Follow-up revisions

RevisionCommit summaryAuthorDate
r5370Two somewhat experimental changes before I fix bug 89:...wmahan23:56, 21 September 2004
r5371Now it is straightforward to fix bug 89, subst: template parameters....wmahan00:15, 22 September 2004

Status & tagging log