From 273c54bff50d87e7a2bda79ee7babb1147c5d605 Mon Sep 17 00:00:00 2001 From: cenarium Date: Tue, 12 Jan 2016 01:34:19 +0100 Subject: [PATCH] Remove patrol config check in User::isAllowed() The isAllowed() function of the User class checks $wgUseRCPatrol and $wgUseNPPatrol in case the action is 'patrol' or 'autopatrol'. Considering we have the useRCPatrol and such functions, it shouldn't. getUserPermissionsErrors of the Title class doesn't and extensions may use patrol regardless of core config. If we don't remove it, we would have to also check the new $wgUseFilePatrol. Change-Id: I671a6b3aa3bd1dc274f2f8e61fb739235ced198c --- includes/user/User.php | 7 ------- 1 file changed, 7 deletions(-) diff --git a/includes/user/User.php b/includes/user/User.php index b406bac680..fc34fcc19c 100644 --- a/includes/user/User.php +++ b/includes/user/User.php @@ -3276,13 +3276,6 @@ class User implements IDBAccessObject { if ( $action === '' ) { return true; // In the spirit of DWIM } - // Patrolling may not be enabled - if ( $action === 'patrol' || $action === 'autopatrol' ) { - global $wgUseRCPatrol, $wgUseNPPatrol; - if ( !$wgUseRCPatrol && !$wgUseNPPatrol ) { - return false; - } - } // Use strict parameter to avoid matching numeric 0 accidentally inserted // by misconfiguration: 0 == 'foo' return in_array( $action, $this->getRights(), true ); -- 2.20.1