Proposed fix for bug 17552. Also the name of the function should be changed, because...
authorTim Starling <tstarling@users.mediawiki.org>
Wed, 18 Feb 2009 12:41:28 +0000 (12:41 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Wed, 18 Feb 2009 12:41:28 +0000 (12:41 +0000)
includes/api/ApiResult.php

index a796d74..f8fa56a 100644 (file)
@@ -221,8 +221,12 @@ class ApiResult extends ApiBase {
         */
        public function setIndexedTagName_internal( $path, $tag ) {
                $data = & $this->mData;
-               foreach((array)$path as $p)
+               foreach((array)$path as $p) {
+                       if ( !isset( $data[$p] ) ) {
+                               $data[$p] = array();
+                       }
                        $data = & $data[$p];
+               }
                if(is_null($data))
                        return;
                $this->setIndexedTagName($data, $tag);