You are here

function password_policy_constraint_letter_validate in Password Policy 7

Same name and namespace in other branches
  1. 6 constraints/constraint_letter.inc \password_policy_constraint_letter_validate()

Password validation.

1 call to password_policy_constraint_letter_validate()
PasswordPolicyTestCase::testLetterConstraint in tests/password_policy.test
Test letter constraint.

File

constraints/constraint_letter.inc, line 29
Password policy constraint callbacks.

Code

function password_policy_constraint_letter_validate($password, $constraint, $account) {
  $matches = array();
  $count = preg_match_all('/[a-z]/i', $password, $matches);
  return $count >= $constraint;
}