Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public function validatePassword ($postPassword1, $postPassword2) {
  2.         $passwordLength = mb_strlen($postPassword1);
  3.         if ($passwordLength < 3) || ($passwordLength > 20)) {
  4.             throw new ValidationException('hasło musi miec 3-20 znakow');
  5.         }
  6.  
  7.         if ($postPassword1 !== $postPassword2) {
  8.             throw new ValidationException('hasła nie sa takie same');
  9.         }
  10.  
  11.         $password_hash = password_hash($postPassword1, PASSWORD_DEFAULT);
  12.         return $password_hash;        
  13.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement