r68875 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r68874‎ | r68875 | r68876 >
Date:12:49, 2 July 2010
Author:yaron
Status:deferred
Tags:
Comment:
Fixed handling of excluded namespaces
Modified paths:
  • /trunk/extensions/ApprovedRevs/ApprovedRevs_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ApprovedRevs/ApprovedRevs_body.php
@@ -14,6 +14,9 @@
1515 * one.
1616 */
1717 public static function getApprovedRevID( $title ) {
 18+ if ( self::hasUnsupportedNamespace( $title ) ) {
 19+ return null;
 20+ }
1821 $dbr = wfGetDB( DB_SLAVE );
1922 $page_id = $title->getArticleId();
2023 $rev_id = $dbr->selectField( 'approved_revs', 'rev_id', array( 'page_id' => $page_id ) );
@@ -46,8 +49,8 @@
4750 * extension doesn't support.
4851 */
4952 public static function hasUnsupportedNamespace( $title ) {
50 - global $egApprovedRevsUnsupportedNamespaces;
51 - $unsupported_namespaces = $egApprovedRevsUnsupportedNamespaces;
 53+ global $egApprovedRevsExcludedNamespaces;
 54+ $unsupported_namespaces = $egApprovedRevsExcludedNamespaces;
5255 $unsupported_namespaces[] = NS_FILE;
5356 $unsupported_namespaces[] = NS_CATEGORY;
5457 $unsupported_namespaces[] = NS_MEDIAWIKI;

Status & tagging log