From: Roan Kattouw Date: Tue, 8 Jan 2008 22:05:39 +0000 (+0000) Subject: Improving r29456: X-Git-Tag: 1.31.0-rc.0~50095 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=f023999c3267a468d87d3959369e058dd2faf965;p=lhc%2Fweb%2Fwiklou.git Improving r29456: * The XML formatting bug is obscure and not trivial to fix, working around it is easier * Added missing braces --- diff --git a/includes/api/ApiQueryInfo.php b/includes/api/ApiQueryInfo.php index f98a4d0760..4c90f8dcbd 100644 --- a/includes/api/ApiQueryInfo.php +++ b/includes/api/ApiQueryInfo.php @@ -201,12 +201,15 @@ class ApiQueryInfo extends ApiQueryBase { if($tok_protect) $res['query']['pages'][$pageid]['protecttoken'] = $wgUser->editToken(); if($fld_protection) - // FIXME: Fix XML formatter + { + // Apparently the XML formatting code doesn't like array(null) + // This is painful to fix, so we'll just work around it if(isset($prottitles[$title->getNamespace()][$title->getDbKey()])) $res['query']['pages'][$pageid]['protection'][] = $prottitles[$title->getNamespace()][$title->getDbKey()]; else $res['query']['pages'][$pageid]['protection'] = array(); - $result->setIndexedTagName($res['query']['pages'][$pageid]['protection'], 'pr'); + $result->setIndexedTagName($res['query']['pages'][$pageid]['protection'], 'pr'); + } } } }