Index: trunk/phase3/includes/Parser.php |
— | — | @@ -3032,7 +3032,7 @@ |
3033 | 3033 | |
3034 | 3034 | $dom = $this->preprocessToDom( $text ); |
3035 | 3035 | $flags = $argsOnly ? PPFrame::NO_TEMPLATES : 0; |
3036 | | - $text = $frame->expand( $dom, 0, $flags ); |
| 3036 | + $text = $frame->expand( $dom, $flags ); |
3037 | 3037 | |
3038 | 3038 | wfProfileOut( $fname ); |
3039 | 3039 | return $text; |
— | — | @@ -3336,7 +3336,7 @@ |
3337 | 3337 | # Just replace the arguments, not any double-brace items |
3338 | 3338 | # This is used for rendered interwiki transclusion |
3339 | 3339 | if ( $isDOM ) { |
3340 | | - $text = $newFrame->expand( $text, 0, PPFrame::NO_TEMPLATES ); |
| 3340 | + $text = $newFrame->expand( $text, PPFrame::NO_TEMPLATES ); |
3341 | 3341 | } else { |
3342 | 3342 | $text = $this->replaceVariables( $text, $newFrame, true ); |
3343 | 3343 | } |
— | — | @@ -3344,7 +3344,7 @@ |
3345 | 3345 | $text = $frame->expand( $text ); |
3346 | 3346 | } |
3347 | 3347 | } elseif ( $isDOM ) { |
3348 | | - $text = $frame->expand( $text, 0, PPFrame::NO_TEMPLATES | PPFrame::NO_ARGS ); |
| 3348 | + $text = $frame->expand( $text, PPFrame::NO_TEMPLATES | PPFrame::NO_ARGS ); |
3349 | 3349 | } |
3350 | 3350 | |
3351 | 3351 | # Prune lower levels off the recursion check path |
— | — | @@ -4972,7 +4972,7 @@ |
4973 | 4973 | $curIndex++; |
4974 | 4974 | } |
4975 | 4975 | if ( $mode == 'replace' ) { |
4976 | | - $outText .= $frame->expand( $node, 0, PPFrame::RECOVER_ORIG ); |
| 4976 | + $outText .= $frame->expand( $node, PPFrame::RECOVER_ORIG ); |
4977 | 4977 | } |
4978 | 4978 | $node = $node->nextSibling; |
4979 | 4979 | } |
— | — | @@ -5000,7 +5000,7 @@ |
5001 | 5001 | } |
5002 | 5002 | } |
5003 | 5003 | if ( $mode == 'get' ) { |
5004 | | - $outText .= $frame->expand( $node, 0, PPFrame::RECOVER_ORIG ); |
| 5004 | + $outText .= $frame->expand( $node, PPFrame::RECOVER_ORIG ); |
5005 | 5005 | } |
5006 | 5006 | $node = $node->nextSibling; |
5007 | 5007 | } while ( $node ); |
— | — | @@ -5012,7 +5012,7 @@ |
5013 | 5013 | // stripped by the editor, so we need both newlines to restore the paragraph gap |
5014 | 5014 | $outText .= $newText . "\n\n"; |
5015 | 5015 | while ( $node ) { |
5016 | | - $outText .= $frame->expand( $node, 0, PPFrame::RECOVER_ORIG ); |
| 5016 | + $outText .= $frame->expand( $node, PPFrame::RECOVER_ORIG ); |
5017 | 5017 | $node = $node->nextSibling; |
5018 | 5018 | } |
5019 | 5019 | } |
— | — | @@ -5283,7 +5283,7 @@ |
5284 | 5284 | * using the current context |
5285 | 5285 | * @param $root the node |
5286 | 5286 | */ |
5287 | | - function expand( $root, $shallowFlags = 0, $deepFlags = 0 ) { |
| 5287 | + function expand( $root, $flags = 0 ) { |
5288 | 5288 | if ( is_string( $root ) ) { |
5289 | 5289 | return $root; |
5290 | 5290 | } |
— | — | @@ -5293,17 +5293,16 @@ |
5294 | 5294 | { |
5295 | 5295 | return $this->parser->insertStripItem( '<!-- node-count limit exceeded -->' ); |
5296 | 5296 | } |
5297 | | - $flags = $shallowFlags | $deepFlags; |
5298 | 5297 | |
5299 | 5298 | if ( is_array( $root ) ) { |
5300 | 5299 | $s = ''; |
5301 | 5300 | foreach ( $root as $node ) { |
5302 | | - $s .= $this->expand( $node, 0, $deepFlags ); |
| 5301 | + $s .= $this->expand( $node, $flags ); |
5303 | 5302 | } |
5304 | 5303 | } elseif ( $root instanceof DOMNodeList ) { |
5305 | 5304 | $s = ''; |
5306 | 5305 | foreach ( $root as $node ) { |
5307 | | - $s .= $this->expand( $node, 0, $deepFlags ); |
| 5306 | + $s .= $this->expand( $node, $flags ); |
5308 | 5307 | } |
5309 | 5308 | } elseif ( $root instanceof DOMNode ) { |
5310 | 5309 | if ( $root->nodeType == XML_TEXT_NODE ) { |
— | — | @@ -5315,7 +5314,7 @@ |
5316 | 5315 | $title = $titles->item( 0 ); |
5317 | 5316 | $parts = $xpath->query( 'part', $root ); |
5318 | 5317 | if ( $flags & self::NO_TEMPLATES ) { |
5319 | | - $s = '{{' . $this->implodeWithFlags( '|', 0, $deepFlags, $title, $parts ) . '}}'; |
| 5318 | + $s = '{{' . $this->implodeWithFlags( '|', $flags, $title, $parts ) . '}}'; |
5320 | 5319 | } else { |
5321 | 5320 | $lineStart = $root->getAttribute( 'lineStart' ); |
5322 | 5321 | $params = array( |
— | — | @@ -5332,7 +5331,7 @@ |
5333 | 5332 | $title = $titles->item( 0 ); |
5334 | 5333 | $parts = $xpath->query( 'part', $root ); |
5335 | 5334 | if ( $flags & self::NO_ARGS || $this->parser->ot['msg'] ) { |
5336 | | - $s = '{{{' . $this->implode( '|', 0, $deepFlags, $title, $parts ) . '}}}'; |
| 5335 | + $s = '{{{' . $this->implode( '|', $flags, $title, $parts ) . '}}}'; |
5337 | 5336 | } else { |
5338 | 5337 | $params = array( 'title' => $title, 'parts' => $parts, 'text' => 'FIXME' ); |
5339 | 5338 | $s = $this->parser->argSubstitution( $params, $this ); |
— | — | @@ -5353,7 +5352,7 @@ |
5354 | 5353 | $s = $this->parser->extensionSubstitution( $params, $this ); |
5355 | 5354 | } elseif ( $root->nodeName == 'h' ) { |
5356 | 5355 | # Heading |
5357 | | - $s = $this->expand( $root->childNodes, 0, $deepFlags ); |
| 5356 | + $s = $this->expand( $root->childNodes, $flags ); |
5358 | 5357 | |
5359 | 5358 | if ( $this->parser->ot['html'] ) { |
5360 | 5359 | # Insert heading index marker |
— | — | @@ -5387,7 +5386,7 @@ |
5388 | 5387 | if ( $node->nodeType == XML_TEXT_NODE ) { |
5389 | 5388 | $s .= $node->nodeValue; |
5390 | 5389 | } elseif ( $node->nodeType == XML_ELEMENT_NODE ) { |
5391 | | - $s .= $this->expand( $node, 0, $deepFlags ); |
| 5390 | + $s .= $this->expand( $node, $flags ); |
5392 | 5391 | } |
5393 | 5392 | } |
5394 | 5393 | } |
— | — | @@ -5397,8 +5396,8 @@ |
5398 | 5397 | return $s; |
5399 | 5398 | } |
5400 | 5399 | |
5401 | | - function implodeWithFlags( $sep, $shallowFlags, $deepFlags /*, ... */ ) { |
5402 | | - $args = array_slice( func_get_args(), 3 ); |
| 5400 | + function implodeWithFlags( $sep, $flags /*, ... */ ) { |
| 5401 | + $args = array_slice( func_get_args(), 2 ); |
5403 | 5402 | |
5404 | 5403 | $first = true; |
5405 | 5404 | $s = ''; |
— | — | @@ -5412,7 +5411,7 @@ |
5413 | 5412 | } else { |
5414 | 5413 | $s .= $sep; |
5415 | 5414 | } |
5416 | | - $s .= $this->expand( $node, $shallowFlags, $deepFlags ); |
| 5415 | + $s .= $this->expand( $node, $flags ); |
5417 | 5416 | } |
5418 | 5417 | } |
5419 | 5418 | return $s; |
— | — | @@ -5420,7 +5419,7 @@ |
5421 | 5420 | |
5422 | 5421 | function implode( $sep /*, ... */ ) { |
5423 | 5422 | $args = func_get_args(); |
5424 | | - $args = array_merge( array_slice( $args, 0, 1 ), array( 0, 0 ), array_slice( $args, 1 ) ); |
| 5423 | + $args = array_merge( array_slice( $args, 0, 1 ), array( 0 ), array_slice( $args, 1 ) ); |
5425 | 5424 | return call_user_func_array( array( $this, 'implodeWithFlags' ), $args ); |
5426 | 5425 | } |
5427 | 5426 | |