r13882 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r13881‎ | r13882 | r13883 >
Date:08:21, 27 April 2006
Author:tstarling
Status:old
Tags:
Comment:
Don't parse the return value of a function-style extension by default.
Modified paths:
  • /trunk/phase3/includes/Parser.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Parser.php
@@ -2670,6 +2670,11 @@
26712671 $funcArgs = array_merge( array( &$this, trim( substr( $part1, $colonPos + 1 ) ) ), $funcArgs );
26722672 $result = call_user_func_array( $this->mFunctionHooks[$function], $funcArgs );
26732673 $found = true;
 2674+
 2675+ // The text is usually already parsed, doesn't need triple-brace tags expanded, etc.
 2676+ $noargs = true;
 2677+ $noparse = true;
 2678+
26742679 if ( is_array( $result ) ) {
26752680 $text = $linestart . $result[0];
26762681 unset( $result[0] );
@@ -2778,7 +2783,9 @@
27792784 if ( $nowiki && $found && $this->mOutputType == OT_HTML ) {
27802785 $text = wfEscapeWikiText( $text );
27812786 } elseif ( ($this->mOutputType == OT_HTML || $this->mOutputType == OT_WIKI) && $found ) {
2782 - if ( !$noargs ) {
 2787+ if ( $noargs ) {
 2788+ $assocArgs = array();
 2789+ } else {
27832790 # Clean up argument array
27842791 $assocArgs = array();
27852792 $index = 1;

Status & tagging log