Skip to content

fix: prevent fatal on long user passwords#191

Closed
Yehonal wants to merge 1 commit into
masterfrom
fix/user-validator-password-length
Closed

fix: prevent fatal on long user passwords#191
Yehonal wants to merge 1 commit into
masterfrom
fix/user-validator-password-length

Conversation

@Yehonal

@Yehonal Yehonal commented Jun 1, 2026

Copy link
Copy Markdown
Member

Summary

  • Fix a fatal error in user password validation when a password exceeds the ACore max length.
  • Qualify the password length constant as UserValidator::PASSWORD_LENGTH and make the validation message explicit.

Why

WordPress-generated passwords can exceed the 16-character ACore account limit. The validator attempted to return a readable error, but referenced an undefined global PASSWORD_LENGTH constant, causing a PHP fatal error instead.

Testing

  • git show --check HEAD
  • Not run: php -l / runtime PHP validation because PHP is not installed on this worker.

@Yehonal

Yehonal commented Jun 1, 2026

Copy link
Copy Markdown
Member Author

Closing as duplicate. Keeping #192 as the active PR for this fix; it has the same patch and CI is passing there.

@Yehonal Yehonal closed this Jun 1, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a PHP fatal error in the WordPress plugin’s password validation path when a password exceeds the AzerothCore max length by ensuring the length constant reference is properly qualified.

Changes:

  • Use UserValidator::PASSWORD_LENGTH (instead of an undefined PASSWORD_LENGTH) in the “password too long” validation error path.
  • Improve the “password too long” validation message wording to be clearer (“%s characters or fewer”).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +24 to +25
__("Password is too long (%s), please use %s characters or fewer", 'acore_wp_plugin'),
strlen($password), UserValidator::PASSWORD_LENGTH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants