From: Tim Starling Date: Sun, 2 Dec 2007 08:27:39 +0000 (+0000) Subject: * Fix incorrect call to PPFrame::implode() from PPFrame::expand() X-Git-Tag: 1.31.0-rc.0~50619 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=commitdiff_plain;h=faac0cfe3f92681fcd0ba9b5ecfd4208614ad25b;p=lhc%2Fweb%2Fwiklou.git * Fix incorrect call to PPFrame::implode() from PPFrame::expand() * Add PPFrame::splitBraceNode() for use in extensions * Remove some obsolete debugging code --- 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