Fix Bug 28354: Edit tab is shown as "view source" for blocked users, which breaks...
authorPaul Copperman <pcopp@users.mediawiki.org>
Tue, 3 May 2011 13:18:57 +0000 (13:18 +0000)
committerPaul Copperman <pcopp@users.mediawiki.org>
Tue, 3 May 2011 13:18:57 +0000 (13:18 +0000)
* Skip user block checks for Title::quickUserCan(). This restores the behavior from 1.16 rsp. before r65504.
* Remove unnecessary check for "$short && count($errors)", this is already handled by getUserPermissionsErrorsInternal().

includes/Title.php

index 5bf8998..2795fd9 100644 (file)
@@ -1175,7 +1175,8 @@ class Title {
         *
         * @param $action String action that permission needs to be checked for
         * @param $user User to check
-        * @param $doExpensiveQueries Bool Set this to false to avoid doing unnecessary queries.
+        * @param $doExpensiveQueries Bool Set this to false to avoid doing unnecessary queries by
+        *   skipping checks for cascading protections and user blocks.
         * @param $ignoreErrors Array of Strings Set this to a list of message keys whose corresponding errors may be ignored.
         * @return Array of arguments to wfMsg to explain permissions problems.
         */
@@ -1521,7 +1522,7 @@ class Title {
         * @return Array list of errors
         */
        private function checkUserBlock( $action, $user, $errors, $doExpensiveQueries, $short ) {
-               if( $short && count( $errors ) > 0 ) {
+               if( !$doExpensiveQueries ) {
                        return $errors;
                }