From: cenarium Date: Tue, 12 Jan 2016 00:34:19 +0000 (+0100) Subject: Remove patrol config check in User::isAllowed() X-Git-Tag: 1.31.0-rc.0~8345^2 X-Git-Url: https://git.cyclocoop.org/%27.%24link.%27?a=commitdiff_plain;h=273c54bff50d87e7a2bda79ee7babb1147c5d605;p=lhc%2Fweb%2Fwiklou.git 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 --- 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 );