From faac0cfe3f92681fcd0ba9b5ecfd4208614ad25b Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Sun, 2 Dec 2007 08:27:39 +0000 Subject: [PATCH] * Fix incorrect call to PPFrame::implode() from PPFrame::expand() * Add PPFrame::splitBraceNode() for use in extensions * Remove some obsolete debugging code --- includes/Parser.php | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/includes/Parser.php b/includes/Parser.php index a51b09c6aa..e32ac7a23f 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -5331,7 +5331,7 @@ class PPFrame { $title = $titles->item( 0 ); $parts = $xpath->query( 'part', $root ); if ( $flags & self::NO_ARGS || $this->parser->ot['msg'] ) { - $s = '{{{' . $this->implode( '|', $flags, $title, $parts ) . '}}}'; + $s = '{{{' . $this->implodeWithFlags( '|', $flags, $title, $parts ) . '}}}'; } else { $params = array( 'title' => $title, 'parts' => $parts, 'text' => 'FIXME' ); $s = $this->parser->argSubstitution( $params, $this ); @@ -5362,21 +5362,7 @@ class PPFrame { $serial = count( $this->parser->mHeadings ) - 1; $marker = "{$this->parser->mUniqPrefix}-h-$serial-{$this->parser->mMarkerSuffix}"; $count = $root->getAttribute( 'level' ); - - // FIXME: bug-for-bug with old parser - // Lose whitespace for no apparent reason - // Remove this after differential testing is done - if ( true ) { - // Good version - $s = substr( $s, 0, $count ) . $marker . substr( $s, $count ); - } else { - // Bad version - if ( preg_match( '/^(={1,6})(.*?)(={1,6})\s*?$/', $s, $m ) ) { - if ( $m[2] != '' ) { - $s = $m[1] . $marker . $m[2] . $m[3]; - } - } - } + $s = substr( $s, 0, $count ) . $marker . substr( $s, $count ); $this->parser->mStripState->general->setPair( $marker, '' ); } } else { @@ -5423,6 +5409,22 @@ class PPFrame { return call_user_func_array( array( $this, 'implodeWithFlags' ), $args ); } + /** + * Split an or