From d9cfc8117434c71f33eb31d906e24c7ea9b0897e Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Sun, 23 Mar 2008 15:35:05 +0000 Subject: [PATCH] There's no reason to put the shortcut above wfRunHooks(). If it's an extension that's the problem, fix the extension. --- includes/Title.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/Title.php b/includes/Title.php index c07d971f76..0c91eab141 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -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 { -- 2.20.1