From d7f69362b9b54535d81c3b094d1699b6e0b40483 Mon Sep 17 00:00:00 2001 From: Simon Coggins Date: Wed, 27 Feb 2013 15:41:37 +1300 Subject: [PATCH] MDL-38102 lib: Check for null return value from password_hash function call --- lib/moodlelib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 6890a8320028e..0dd6e7df0d4f5 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -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.'); }