Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function validatePassword ($postPassword1, $postPassword2) {
- $passwordLength = mb_strlen($postPassword1);
- if ($passwordLength < 3) || ($passwordLength > 20)) {
- throw new ValidationException('hasło musi miec 3-20 znakow');
- }
- if ($postPassword1 !== $postPassword2) {
- throw new ValidationException('hasła nie sa takie same');
- }
- $password_hash = password_hash($postPassword1, PASSWORD_DEFAULT);
- return $password_hash;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement