Auto-submit four digit launcher PIN
This commit is contained in:
@@ -10,7 +10,7 @@ $config = custom_config();
|
||||
|
||||
function launcher_is_digit_password(string $password): bool
|
||||
{
|
||||
return $password !== '' && ctype_digit($password);
|
||||
return preg_match('/^\d{4}$/', $password) === 1;
|
||||
}
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
@@ -48,10 +48,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
custom_json(['result' => 'fail', 'message' => 'current_password_invalid'], 401);
|
||||
}
|
||||
|
||||
if (mb_strlen($next) < 4) {
|
||||
custom_json(['result' => 'fail', 'message' => 'password_too_short'], 422);
|
||||
}
|
||||
|
||||
if (!custom_save_password_hash(password_hash($next, PASSWORD_DEFAULT))) {
|
||||
custom_json(['result' => 'fail', 'message' => 'password_save_failed'], 500);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user