regex configuration constants
This commit is contained in:
@@ -29,7 +29,7 @@ if (empty($_SESSION['username'])) {
|
||||
|
||||
// 4) Validate username format
|
||||
$userId = $_SESSION['username'];
|
||||
if (!preg_match('/^[\p{L}\p{N}_\- ]+$/u', $userId)) {
|
||||
if (!preg_match(REGEX_USER, $userId)) {
|
||||
http_response_code(400);
|
||||
error_log("totp_saveCode: invalid username format: {$userId}");
|
||||
exit(json_encode(['status'=>'error','message'=>'Invalid user identifier']));
|
||||
|
||||
Reference in New Issue
Block a user