MDL-38102 lib: Check for null return value from password_hash function call

This commit is contained in:
Simon Coggins 2013-02-27 15:41:37 +13:00
parent f29e62cb6c
commit d7f69362b9

View file

@ -4483,7 +4483,7 @@ function hash_internal_user_password($password, $fasthash = false) {
$generatedhash = password_hash($password, PASSWORD_DEFAULT, $options);
if ($generatedhash === false) {
if ($generatedhash === false || $generatedhash === null) {
throw new moodle_exception('Failed to generate password hash.');
}