From 7fa617fcfd51068512fb9df1ee11d05d9044cb88 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Wed, 18 Feb 2009 12:41:28 +0000 Subject: [PATCH] Proposed fix for bug 17552. Also the name of the function should be changed, because there's nothing internal about it. --- includes/api/ApiResult.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/includes/api/ApiResult.php b/includes/api/ApiResult.php index a796d74c71..f8fa56a20d 100644 --- a/includes/api/ApiResult.php +++ b/includes/api/ApiResult.php @@ -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); -- 2.20.1