Merge "ApiTestCase: Set correct user for derivate requests"
[lhc/web/wiklou.git] / includes / parser / Preprocessor_DOM.php
index 0351f2a..ff34d9b 100644 (file)
@@ -853,7 +853,8 @@ class PPDStackElement {
                $close,             // Matching closing character
                $count,             // Number of opening characters found (number of "=" for heading)
                $parts,             // Array of PPDPart objects describing pipe-separated parts.
-               $lineStart;         // True if the open char appeared at the start of the input line. Not set for headings.
+               $lineStart;         // True if the open char appeared at the start of the input line.
+                                   // Not set for headings.
 
        public $partClass = 'PPDPart';
 
@@ -1029,6 +1030,10 @@ class PPFrame_DOM implements PPFrame {
                                        $index = $nameNodes->item( 0 )->attributes->getNamedItem( 'index' )->textContent;
                                        $index = $index - $indexOffset;
                                        if ( isset( $namedArgs[$index] ) || isset( $numberedArgs[$index] ) ) {
+                                               $this->parser->getOutput()->addWarning( wfMessage( 'duplicate-args-warning',
+                                                       wfEscapeWikiText( $this->title ),
+                                                       wfEscapeWikiText( $title ),
+                                                       wfEscapeWikiText( $index ) )->text() );
                                                $this->parser->addTrackingCategory( 'duplicate-args-category' );
                                        }
                                        $numberedArgs[$index] = $value->item( 0 );
@@ -1037,6 +1042,10 @@ class PPFrame_DOM implements PPFrame {
                                        // Named parameter
                                        $name = trim( $this->expand( $nameNodes->item( 0 ), PPFrame::STRIP_COMMENTS ) );
                                        if ( isset( $namedArgs[$name] ) || isset( $numberedArgs[$name] ) ) {
+                                               $this->parser->getOutput()->addWarning( wfMessage( 'duplicate-args-warning',
+                                                       wfEscapeWikiText( $this->title ),
+                                                       wfEscapeWikiText( $title ),
+                                                       wfEscapeWikiText( $name ) )->text() );
                                                $this->parser->addTrackingCategory( 'duplicate-args-category' );
                                        }
                                        $namedArgs[$name] = $value->item( 0 );
@@ -1263,7 +1272,7 @@ class PPFrame_DOM implements PPFrame {
                                                $titleText = $this->title->getPrefixedDBkey();
                                                $this->parser->mHeadings[] = array( $titleText, $headingIndex );
                                                $serial = count( $this->parser->mHeadings ) - 1;
-                                               $marker = "{$this->parser->mUniqPrefix}-h-$serial-" . Parser::MARKER_SUFFIX;
+                                               $marker = Parser::MARKER_PREFIX . "-h-$serial-" . Parser::MARKER_SUFFIX;
                                                $count = $contextNode->getAttribute( 'level' );
                                                $s = substr( $s, 0, $count ) . $marker . substr( $s, $count );
                                                $this->parser->mStripState->addGeneral( $marker, '' );