You are here

function password_policy_constraint_uppercase_validate in Password Policy 7

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

Password validation.

1 call to password_policy_constraint_uppercase_validate()
PasswordPolicyTestCase::testUppercaseConstraint in tests/password_policy.test
Test uppercase constraint.

File

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

Code

function password_policy_constraint_uppercase_validate($password, $constraint, $account) {
  $matches = array();
  $count = preg_match_all('/[A-Z]/', $password, $matches);
  return $count >= $constraint;
}