From f023999c3267a468d87d3959369e058dd2faf965 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Tue, 8 Jan 2008 22:05:39 +0000 Subject: [PATCH] Improving r29456: * The XML formatting bug is obscure and not trivial to fix, working around it is easier * Added missing braces --- includes/api/ApiQueryInfo.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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'); + } } } } -- 2.20.1