X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fuser%2FPasswordReset.php;h=aada3192e38da37db64e1ee6c05e3931c8cb07d5;hb=4fde90cf97328c12af11d0410d230b4388a323ba;hp=f65bae5aa70e40d07077a195ae94048911ace8ce;hpb=f011251dc756d858e63a29931a2406dd6aee61df;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/user/PasswordReset.php b/includes/user/PasswordReset.php index f65bae5aa7..aada3192e3 100644 --- a/includes/user/PasswordReset.php +++ b/includes/user/PasswordReset.php @@ -81,9 +81,7 @@ class PasswordReset implements LoggerAwareInterface { $resetRoutes = $this->config->get( 'PasswordResetRoutes' ); $status = StatusValue::newGood(); - if ( !is_array( $resetRoutes ) || - !in_array( true, array_values( $resetRoutes ), true ) - ) { + if ( !is_array( $resetRoutes ) || !in_array( true, $resetRoutes, true ) ) { // Maybe password resets are disabled, or there are no allowable routes $status = StatusValue::newFatal( 'passwordreset-disabled' ); } elseif ( @@ -265,23 +263,7 @@ class PasswordReset implements LoggerAwareInterface { if ( !$block ) { return false; } - $type = $block->getSystemBlockType(); - if ( in_array( $type, [ null, 'global-block' ], true ) ) { - // Normal block. Maybe it was meant for someone else and the user just needs to log in; - // or maybe it was issued specifically to prevent some IP from messing with password - // reset? Go out on a limb and use the registration allowed flag to decide. - return $block->prevents( 'createaccount' ); - } elseif ( $type === 'proxy' ) { - // we disallow actions through proxy even if the user is logged in - // so it makes sense to disallow password resets as well - return true; - } elseif ( in_array( $type, [ 'dnsbl', 'wgSoftBlockRanges' ], true ) ) { - // these are just meant to force login so let's not prevent that - return false; - } else { - // some extension - we'll have to guess - return true; - } + return $block->appliesToPasswordReset(); } /**