Merge "$wgUseSquid unused since parent commit (fa1a8d5)"
[lhc/web/wiklou.git] / includes / parser / Preprocessor_DOM.php
index 5bb951b..f991df2 100644 (file)
@@ -926,7 +926,7 @@ class PPFrame_DOM implements PPFrame {
         *
         * @return PPTemplateFrame_DOM
         */
-       function newChild( $args = false, $title = false ) {
+       function newChild( $args = false, $title = false, $indexOffset = 0 ) {
                $namedArgs = array();
                $numberedArgs = array();
                if ( $title === false ) {
@@ -938,6 +938,9 @@ class PPFrame_DOM implements PPFrame {
                                $args = $args->node;
                        }
                        foreach ( $args as $arg ) {
+                               if ( $arg instanceof PPNode ) {
+                                       $arg = $arg->node;
+                               }
                                if ( !$xpath ) {
                                        $xpath = new DOMXPath( $arg->ownerDocument );
                                }
@@ -947,6 +950,7 @@ class PPFrame_DOM implements PPFrame {
                                if ( $nameNodes->item( 0 )->hasAttributes() ) {
                                        // Numbered parameter
                                        $index = $nameNodes->item( 0 )->attributes->getNamedItem( 'index' )->textContent;
+                                       $index = $index - $indexOffset;
                                        $numberedArgs[$index] = $value->item( 0 );
                                        unset( $namedArgs[$index] );
                                } else {
@@ -1549,6 +1553,10 @@ class PPCustomFrame_DOM extends PPFrame_DOM {
                }
                return $this->args[$index];
        }
+
+       function getArguments() {
+               return $this->args;
+       }
 }
 
 /**