Change action=paraminfo's format to something that won't render invalid XML
authorRoan Kattouw <catrope@users.mediawiki.org>
Fri, 25 Jan 2008 12:28:18 +0000 (12:28 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Fri, 25 Jan 2008 12:28:18 +0000 (12:28 +0000)
includes/api/ApiParamInfo.php

index b14fafc..563c20f 100644 (file)
@@ -49,12 +49,15 @@ class ApiParamInfo extends ApiBase {
                        {\r
                                if(!isset($modArr[$m]))\r
                                {\r
-                                       $r['modules'][$m] = array('missing' => '');\r
+                                       $r['modules'][] = array('name' => $m, 'missing' => '');\r
                                        continue;\r
                                }\r
                                $obj = new $modArr[$m]($this->getMain(), $m);\r
-                               $r['modules'][$m] = $this->getClassInfo($obj);                          \r
+                               $a = $this->getClassInfo($obj);\r
+                               $a['name'] = $m;\r
+                               $r['modules'][] = $a;                           \r
                        }\r
+                       $result->setIndexedTagName($r['modules'], 'module');\r
                }\r
                if(is_array($params['querymodules']))\r
                {\r
@@ -64,12 +67,15 @@ class ApiParamInfo extends ApiBase {
                        {\r
                                if(!isset($qmodArr[$qm]))\r
                                {\r
-                                       $r['querymodules'][$qm] = array('missing' => '');\r
+                                       $r['querymodules'][] = array('name' => $qm, 'missing' => '');\r
                                        continue;\r
                                }\r
                                $obj = new $qmodArr[$qm]($this, $qm);\r
-                               $r['querymodules'][$qm] = $this->getClassInfo($obj);\r
+                               $a = $this->getClassInfo($obj);\r
+                               $a['name'] = $qm;\r
+                               $r['querymodules'][] = $a;\r
                        }\r
+                       $result->setIndexedTagName($r['querymodules'], 'module');\r
                }\r
                $result->addValue(null, $this->getModuleName(), $r);\r
        }\r