add compatibility library for password functions (PHP<=5.5)
This commit is contained in:
parent
5d86b5527b
commit
0e7ea50bd5
2 changed files with 326 additions and 0 deletions
|
|
@ -218,6 +218,11 @@
|
|||
*/
|
||||
public function hash($password)
|
||||
{
|
||||
if(!function_exists('password_hash')) {
|
||||
\hhu\z\lib\Password::load();
|
||||
}
|
||||
|
||||
|
||||
return password_hash($password, PASSWORD_DEFAULT);
|
||||
}
|
||||
|
||||
|
|
@ -231,6 +236,11 @@
|
|||
*/
|
||||
private function verify($password, $hash)
|
||||
{
|
||||
if(!function_exists('password_verify')) {
|
||||
\hhu\z\lib\Password::load();
|
||||
}
|
||||
|
||||
|
||||
return password_verify($password, $hash);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue