API: Adding cascade flag to prop=info&inprop=protection
authorRoan Kattouw <catrope@users.mediawiki.org>
Tue, 15 Jan 2008 15:23:27 +0000 (15:23 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Tue, 15 Jan 2008 15:23:27 +0000 (15:23 +0000)
RELEASE-NOTES
includes/api/ApiQueryInfo.php

index 33c8392..fcf0106 100644 (file)
@@ -433,6 +433,7 @@ Full API documentation is available at http://www.mediawiki.org/wiki/API
 * (bug 12413) meta=userinfo missing <query> 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 ===
 
index 6664048..f6a5019 100644 (file)
@@ -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);
                }