summaryrefslogtreecommitdiffstats
path: root/application/models/muser.php
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2016-03-29 00:24:29 +0200
committerFlorian Pritz <bluewind@xinu.at>2016-03-29 00:24:29 +0200
commit41d58f68e34e714e6c4cac5176d3fb40b762fa0b (patch)
tree6466f578451cfef58521804200bd1e8761cfcd17 /application/models/muser.php
parenta47379cb313f5966ee1e783a0357860b7d4ba400 (diff)
Catch potential password hashing errors
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/models/muser.php')
-rw-r--r--application/models/muser.php6
1 files changed, 5 insertions, 1 deletions
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;
}
}