There's no reason to put the shortcut above wfRunHooks(). If it's an extension that...
authorAryeh Gregor <simetrical@users.mediawiki.org>
Sun, 23 Mar 2008 15:35:05 +0000 (15:35 +0000)
committerAryeh Gregor <simetrical@users.mediawiki.org>
Sun, 23 Mar 2008 15:35:05 +0000 (15:35 +0000)
includes/Title.php

index c07d971..0c91eab 100644 (file)
@@ -1389,16 +1389,16 @@ class Title {
        public function userCanRead() {
                global $wgUser, $wgGroupPermissions;
 
-               # Shortcut for public wikis, allows skipping quite a bit of code path
-               if ($wgGroupPermissions['*']['read'])
-                       return true;
-
                $result = null;
                wfRunHooks( 'userCan', array( &$this, &$wgUser, 'read', &$result ) );
                if ( $result !== null ) {
                        return $result;
                }
 
+               # Shortcut for public wikis, allows skipping quite a bit of code
+               if ($wgGroupPermissions['*']['read'])
+                       return true;
+
                if( $wgUser->isAllowed( 'read' ) ) {
                        return true;
                } else {