r44293 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44292‎ | r44293 | r44294 >
Date:22:03, 7 December 2008
Author:aaron
Status:deferred
Tags:
Comment:
Short-circuit ns checks a bit better
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.class.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php
@@ -878,11 +878,11 @@
879879 global $wgFlaggedRevsNamespaces, $wgFlaggedRevsWhitelist;
880880 # FIXME: Treat NS_MEDIA as NS_IMAGE
881881 $ns = ( $title->getNamespace() == NS_MEDIA ) ? NS_IMAGE : $title->getNamespace();
882 - # Check whitelist for exempt pages
883 - if( in_array( $title->getPrefixedDBKey(), $wgFlaggedRevsWhitelist ) ) {
 882+ # Check for MW: pages and whitelist for exempt pages
 883+ if( $ns == NS_MEDIAWIKI || in_array( $title->getPrefixedDBKey(), $wgFlaggedRevsWhitelist ) ) {
884884 return false;
885885 }
886 - return ( in_array($ns,$wgFlaggedRevsNamespaces) && !$title->isTalkPage() && $ns != NS_MEDIAWIKI );
 886+ return ( in_array($ns,$wgFlaggedRevsNamespaces) && !$title->isTalkPage() );
887887 }
888888
889889 /**
@@ -894,11 +894,11 @@
895895 global $wgFeedbackNamespaces, $wgFlaggedRevsWhitelist;
896896 # FIXME: Treat NS_MEDIA as NS_IMAGE
897897 $ns = ( $title->getNamespace() == NS_MEDIA ) ? NS_IMAGE : $title->getNamespace();
898 - # Check whitelist for exempt pages
899 - if( in_array( $title->getPrefixedDBKey(), $wgFlaggedRevsWhitelist ) ) {
 898+ # Check for MW: pages and whitelist for exempt pages
 899+ if( $ns == NS_MEDIAWIKI || in_array( $title->getPrefixedDBKey(), $wgFlaggedRevsWhitelist ) ) {
900900 return false;
901901 }
902 - return ( in_array($ns,$wgFeedbackNamespaces) && !$title->isTalkPage() && $ns != NS_MEDIAWIKI );
 902+ return ( in_array($ns,$wgFeedbackNamespaces) && !$title->isTalkPage() );
903903 }
904904
905905 /**

Status & tagging log