From 03e6a6943330a6778a7822da3a82f20868741d99 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Tue, 15 Jan 2008 15:23:27 +0000 Subject: [PATCH] API: Adding cascade flag to prop=info&inprop=protection --- RELEASE-NOTES | 1 + includes/api/ApiQueryInfo.php | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) 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); } -- 2.20.1