<?php
/**
- * Implements the BcryptPassword class for the MediaWiki software.
+ * Implements the MWSaltedPassword class for the MediaWiki software.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*/
class MWSaltedPassword extends ParameterizedPassword {
protected function getDefaultParams() {
- return array();
+ return [];
}
protected function getDelimiter() {
}
$this->hash = md5( $this->args[0] . '-' . md5( $plaintext ) );
+
+ if ( !is_string( $this->hash ) || strlen( $this->hash ) < 32 ) {
+ throw new PasswordError( 'Error when hashing password.' );
+ }
}
}