From: Roan Kattouw Date: Tue, 8 Jan 2008 21:42:00 +0000 (+0000) Subject: API: Temporary fix for broken XML rendering; XML formatter apparently doesn't like... X-Git-Tag: 1.31.0-rc.0~50097 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/journal.php?a=commitdiff_plain;h=1aaec79b5879e526effb2f28679c1805b2aec351;p=lhc%2Fweb%2Fwiklou.git API: Temporary fix for broken XML rendering; XML formatter apparently doesn't like array(null). Will attempt to fix the real issue later --- diff --git a/includes/api/ApiQueryInfo.php b/includes/api/ApiQueryInfo.php index 1450ad1718..f98a4d0760 100644 --- a/includes/api/ApiQueryInfo.php +++ b/includes/api/ApiQueryInfo.php @@ -109,6 +109,7 @@ class ApiQueryInfo extends ApiQueryBase { $this->addFields(array('pt_title', 'pt_namespace', 'pt_create_perm', 'pt_expiry')); $this->addWhere($lb->constructSet('pt', $db)); $res = $this->select(__METHOD__); + $prottitles = array(); while($row = $db->fetchObject($res)) { $prottitles[$row->pt_namespace][$row->pt_title] = array( 'type' => 'create', @@ -200,7 +201,11 @@ class ApiQueryInfo extends ApiQueryBase { if($tok_protect) $res['query']['pages'][$pageid]['protecttoken'] = $wgUser->editToken(); if($fld_protection) - $res['query']['pages'][$pageid]['protection'][] = $prottitles[$title->getNamespace()][$title->getDbKey()]; + // FIXME: Fix XML formatter + 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'); } }