= 5 && $zeichenAnzahl <= 12; } /** * Prüft ein optionales Passwort. * * Ein leeres Passwort ist erlaubt und bedeutet, * dass das bestehende Passwort unverändert bleibt. * Falls ein Passwort angegeben wurde, wird es * mit den normalen Passwortregeln geprüft. * * @param string|null $password Zu prüfendes Passwort * * @return bool true wenn das Passwort gültig oder leer ist, * sonst false */ function userOptionalPasswordValidator($password) { if (!isset($password) || $password === '') { return true; } return userPasswordValidator($password); }