Skip to content

Commit e4eca9f

Browse files
caseylockerclaude
andcommitted
fix: move hyphen to end of password validation regex character class
The hyphen character was positioned between * and + in the regex character class [#?!@$%^&*-+], causing it to be interpreted as a range operator (ASCII 42-43) instead of a literal hyphen (ASCII 45). This caused passwords containing hyphens to fail validation while passwords with asterisks passed. Moving the hyphen to the end of the character class [#?!@$%^&*+-] ensures it is treated as a literal character. Regression introduced in 757e964. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 2217ef7 commit e4eca9f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

config/auth.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@
102102
'password_reset_lifetime' => env('AUTH_PASSWORD_RESET_LIFETIME', 1800),
103103
'password_min_length' => env('AUTH_PASSWORD_MIN_LENGTH', 8),
104104
'password_max_length' => env('AUTH_PASSWORD_MAX_LENGTH', 30),
105-
'password_allowed_special_characters' => env('AUTH_PASSWORD_ALLOWED_SPECIAL_CHARACTERS', '[A-Za-z0-9#?!@$%^&*-+]'),
106-
'password_shape_pattern' => env('AUTH_PASSWORD_SHAPE_PATTERN', '^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-+])[A-Za-z0-9#?!@$%^&*-+]+$'),
107-
'password_shape_warning' => env('AUTH_PASSWORD_SHAPE_WARNING', 'Password must include at least one uppercase letter, one lowercase letter, one number, and one special character (#?!@$%^&*-+).'),
105+
'password_allowed_special_characters' => env('AUTH_PASSWORD_ALLOWED_SPECIAL_CHARACTERS', '[A-Za-z0-9#?!@$%^&*+-]'),
106+
'password_shape_pattern' => env('AUTH_PASSWORD_SHAPE_PATTERN', '^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*+-])[A-Za-z0-9#?!@$%^&*+-]+$'),
107+
'password_shape_warning' => env('AUTH_PASSWORD_SHAPE_WARNING', 'Password must include at least one uppercase letter, one lowercase letter, one number, and one special character (#?!@$%^&*+-).'),
108108
'verification_email_lifetime' => env("AUTH_VERIFICATION_EMAIL_LIFETIME", 600),
109109
'allows_native_auth' => env('AUTH_ALLOWS_NATIVE_AUTH', 1),
110110
'allows_native_on_config' => env('AUTH_ALLOWS_NATIVE_AUTH_CONFIG', 1),

0 commit comments

Comments
 (0)