X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fpassword%2FMWSaltedPassword.php;h=733984cfd793e3ef8fb874dc3d6e0697d1e329a6;hb=e73328601d51674e8fef89c3db12b30ceafd702f;hp=f061f52857b2b16479e4e9fffd8eee54df650c62;hpb=25d33bacb3496e9acb6ec0d7147b48a6a552c81d;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/password/MWSaltedPassword.php b/includes/password/MWSaltedPassword.php index f061f52857..733984cfd7 100644 --- a/includes/password/MWSaltedPassword.php +++ b/includes/password/MWSaltedPassword.php @@ -29,7 +29,7 @@ */ class MWSaltedPassword extends ParameterizedPassword { protected function getDefaultParams() { - return array(); + return []; } protected function getDelimiter() { @@ -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.' ); + } } }