X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fpassword%2FMWOldPassword.php;h=84675c16d682c6c083951f4afab26a4ef0d5894d;hb=956967415397d64f7c67259f190e8122a0b32506;hp=afa5cacc783f2cc51e550f10e680c3f39a1da6ed;hpb=dd53b928b933ece1478c04b41c1ef3067ecbebae;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/password/MWOldPassword.php b/includes/password/MWOldPassword.php index afa5cacc78..84675c16d6 100644 --- a/includes/password/MWOldPassword.php +++ b/includes/password/MWOldPassword.php @@ -28,7 +28,7 @@ */ class MWOldPassword extends ParameterizedPassword { protected function getDefaultParams() { - return array(); + return []; } protected function getDelimiter() { @@ -41,8 +41,12 @@ class MWOldPassword extends ParameterizedPassword { if ( $wgPasswordSalt && count( $this->args ) === 1 ) { $this->hash = md5( $this->args[0] . '-' . md5( $plaintext ) ); } else { - $this->args = array(); + $this->args = []; $this->hash = md5( $plaintext ); } + + if ( !is_string( $this->hash ) || strlen( $this->hash ) < 32 ) { + throw new PasswordError( 'Error when hashing password.' ); + } } }