X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fpassword%2FMWSaltedPassword.php;h=733984cfd793e3ef8fb874dc3d6e0697d1e329a6;hb=5bad47dbb4519d6a67a2aba468fb513319311c9a;hp=26730b17b3930fc3f30955dce5cf13d514a72cbf;hpb=8eac2feedb7ee093d2c48504e1eb2b8a9dbc8452;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/password/MWSaltedPassword.php b/includes/password/MWSaltedPassword.php index 26730b17b3..733984cfd7 100644 --- a/includes/password/MWSaltedPassword.php +++ b/includes/password/MWSaltedPassword.php @@ -42,5 +42,9 @@ class MWSaltedPassword extends ParameterizedPassword { } $this->hash = md5( $this->args[0] . '-' . md5( $plaintext ) ); + + if ( !is_string( $this->hash ) || strlen( $this->hash ) < 32 ) { + throw new PasswordError( 'Error when hashing password.' ); + } } }