From: Paul Copperman Date: Tue, 3 May 2011 13:18:57 +0000 (+0000) Subject: Fix Bug 28354: Edit tab is shown as "view source" for blocked users, which breaks... X-Git-Tag: 1.31.0-rc.0~30438 X-Git-Url: http://git.cyclocoop.org/%22%20%20.%20generer_url_ecrire%28%22mots_tous%22%29%20.%20%22?a=commitdiff_plain;h=83d79be8da537d46f98bf623c3217be4c16fe828;p=lhc%2Fweb%2Fwiklou.git 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(). --- 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; }