From 36521ce33cec57772e3183edce7ae427cd97acc3 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Thu, 27 Apr 2006 08:21:42 +0000 Subject: [PATCH] Don't parse the return value of a function-style extension by default. --- includes/Parser.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/includes/Parser.php b/includes/Parser.php index facee90792..17f70949c7 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -2670,6 +2670,11 @@ class Parser $funcArgs = array_merge( array( &$this, trim( substr( $part1, $colonPos + 1 ) ) ), $funcArgs ); $result = call_user_func_array( $this->mFunctionHooks[$function], $funcArgs ); $found = true; + + // The text is usually already parsed, doesn't need triple-brace tags expanded, etc. + $noargs = true; + $noparse = true; + if ( is_array( $result ) ) { $text = $linestart . $result[0]; unset( $result[0] ); @@ -2778,7 +2783,9 @@ class Parser if ( $nowiki && $found && $this->mOutputType == OT_HTML ) { $text = wfEscapeWikiText( $text ); } elseif ( ($this->mOutputType == OT_HTML || $this->mOutputType == OT_WIKI) && $found ) { - if ( !$noargs ) { + if ( $noargs ) { + $assocArgs = array(); + } else { # Clean up argument array $assocArgs = array(); $index = 1; -- 2.20.1