From 83d79be8da537d46f98bf623c3217be4c16fe828 Mon Sep 17 00:00:00 2001 From: Paul Copperman Date: Tue, 3 May 2011 13:18:57 +0000 Subject: [PATCH] Fix Bug 28354: Edit tab is shown as "view source" for blocked users, which breaks squid caching * 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 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/includes/Title.php b/includes/Title.php index 5bf8998041..2795fd9c5f 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -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; } -- 2.20.1