From 41d58f68e34e714e6c4cac5176d3fb40b762fa0b Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Tue, 29 Mar 2016 00:24:29 +0200 Subject: Catch potential password hashing errors Signed-off-by: Florian Pritz --- application/models/muser.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/application/models/muser.php b/application/models/muser.php index 947797034..ced8c5ca2 100644 --- a/application/models/muser.php +++ b/application/models/muser.php @@ -258,7 +258,11 @@ class Muser extends CI_Model { function hash_password($password) { - return password_hash($password, PASSWORD_DEFAULT); + $hash = password_hash($password, PASSWORD_DEFAULT); + if ($hash === false) { + throw new \exceptions\ApiException('user/hash_password/failed', "Failed to hash password"); + } + return $hash; } } -- cgit v1.2.3-24-g4f1b