From: Roan Kattouw Date: Tue, 15 Jan 2008 15:23:27 +0000 (+0000) Subject: API: Adding cascade flag to prop=info&inprop=protection X-Git-Tag: 1.31.0-rc.0~49988 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/journal.php?a=commitdiff_plain;h=03e6a6943330a6778a7822da3a82f20868741d99;p=lhc%2Fweb%2Fwiklou.git API: Adding cascade flag to prop=info&inprop=protection --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 33c8392557..fcf0106df2 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -433,6 +433,7 @@ Full API documentation is available at http://www.mediawiki.org/wiki/API * (bug 12413) meta=userinfo missing tag * Add list of sections to action=parse output * Added action=logout +* Added cascade flag to prop=info&inprop=protections === Languages updated in 1.12 === diff --git a/includes/api/ApiQueryInfo.php b/includes/api/ApiQueryInfo.php index 6664048e95..f6a5019646 100644 --- a/includes/api/ApiQueryInfo.php +++ b/includes/api/ApiQueryInfo.php @@ -86,16 +86,19 @@ class ApiQueryInfo extends ApiQueryBase { $db = $this->getDB(); if ($fld_protection && !empty($titles)) { $this->addTables('page_restrictions'); - $this->addFields(array('pr_page', 'pr_type', 'pr_level', 'pr_expiry')); + $this->addFields(array('pr_page', 'pr_type', 'pr_level', 'pr_expiry', 'pr_cascade')); $this->addWhereFld('pr_page', array_keys($titles)); $res = $this->select(__METHOD__); while($row = $db->fetchObject($res)) { - $protections[$row->pr_page][] = array( + $a = array( 'type' => $row->pr_type, 'level' => $row->pr_level, 'expiry' => Block::decodeExpiry( $row->pr_expiry, TS_ISO_8601 ) ); + if($row->pr_cascade) + $a['cascade'] = ''; + $protections[$row->pr_page][] = $a; } $db->freeResult($res); }