-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers
Description
Code of Conduct
- I agree to follow this project's Code of Conduct.
Submission validity
- This is not a personal support request, that should be posted on discussions community.
- I checked current issues and this request isn't a duplicate of an existing issue, opened or closed.
Self troubleshooting
- I've read the documentation and made sure to follow it.
- I've read the troubleshooting first steps and frequent issues guides.
Version
1.9.1
Description
If a user's name includes square brackets, the password will not be encrypted and a preg_replace error is reported.
Expectation
The password to be encrypted without any issue.
Reproduction steps
Add
$yourls_user_passwords = array(
'testuser[2]' => 'password',
);Context
Seems like the bracket might be breaking something for the preg_replace pattern.
YOURLS/includes/functions-auth.php
Line 216 in 3b69f2b
| $pattern = "/[$quotes]${user}[$quotes]\s*=>\s*[$quotes]" . preg_quote( $password, '/' ) . "[$quotes]/"; |
I only tried curly braces as an additional test, which did work, but even just 1 square bracket breaks the encryption.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers