r82688 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r82687‎ | r82688 | r82689 >
Date:18:01, 23 February 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Only existing pages can be approved
Modified paths:
  • /trunk/extensions/ApprovedRevs/ApprovedRevs_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ApprovedRevs/ApprovedRevs_body.php
@@ -78,18 +78,23 @@
7979 * approvable. Also stores the boolean answer as a field in the page
8080 * object, to speed up processing if it's called more than once.
8181 */
82 - public static function pageIsApprovable( $title ) {
 82+ public static function pageIsApprovable( Title $title ) {
8383 // if this function was already called for this page, the
8484 // value should have been stored as a field in the $title object
8585 if ( isset( $title->isApprovable ) ) {
8686 return $title->isApprovable;
8787 }
8888
 89+ if ( !$title->exists() ) {
 90+ $title->isApprovable = false;
 91+ return $title->isApprovable;
 92+ }
 93+
8994 // check the namespace
9095 global $egApprovedRevsNamespaces;
9196 if ( in_array( $title->getNamespace(), $egApprovedRevsNamespaces ) ) {
9297 $title->isApprovable = true;
93 - return true;
 98+ return $title->isApprovable;
9499 }
95100
96101 // it's not in an included namespace, so check for the page

Status & tagging log