r29793 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r29792‎ | r29793 | r29794 >
Date:15:23, 15 January 2008
Author:catrope
Status:old
Tags:
Comment:
API: Adding cascade flag to prop=info&inprop=protection
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryInfo.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryInfo.php
@@ -86,16 +86,19 @@
8787 $db = $this->getDB();
8888 if ($fld_protection && !empty($titles)) {
8989 $this->addTables('page_restrictions');
90 - $this->addFields(array('pr_page', 'pr_type', 'pr_level', 'pr_expiry'));
 90+ $this->addFields(array('pr_page', 'pr_type', 'pr_level', 'pr_expiry', 'pr_cascade'));
9191 $this->addWhereFld('pr_page', array_keys($titles));
9292
9393 $res = $this->select(__METHOD__);
9494 while($row = $db->fetchObject($res)) {
95 - $protections[$row->pr_page][] = array(
 95+ $a = array(
9696 'type' => $row->pr_type,
9797 'level' => $row->pr_level,
9898 'expiry' => Block::decodeExpiry( $row->pr_expiry, TS_ISO_8601 )
9999 );
 100+ if($row->pr_cascade)
 101+ $a['cascade'] = '';
 102+ $protections[$row->pr_page][] = $a;
100103 }
101104 $db->freeResult($res);
102105 }
Index: trunk/phase3/RELEASE-NOTES
@@ -433,6 +433,7 @@
434434 * (bug 12413) meta=userinfo missing <query> tag
435435 * Add list of sections to action=parse output
436436 * Added action=logout
 437+* Added cascade flag to prop=info&inprop=protections
437438
438439 === Languages updated in 1.12 ===
439440

Status & tagging log