-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Post: add a max length to the post password protected field #64156
Conversation
Size Change: +9 B (0%) Total Size: 1.76 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me.
I'm wondering if we ought to add an inline alert if the user attempts to enter a password that is too long but don't think it's a blocker.
Note for others testing: when viewing the post on the front-end to test, you will need to remove the size attribute from the form field for it to accept passwords longer than 20 characters. This is been fixed in core-61703
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Yeah, that might help to inform users in lieu of a cryptic server error. I was also thinking that it could be a little UX improvement to uncheck the password checkbox if a user clears it. At the moment it stays open with an empty field. 0411e662db3a7a7609847dd018095475.mp4I didn't want to overcomplicate this change though. I can create an issue for the above so it's on record. |
|
What?
Fixes: #64155
Limits the post password protected field to 255 chars.
Why?
To avoid the database error:
See explanation in #64155
How?
maxlength
HTML attribute.Testing Instructions
The following password has 258 characters.
glom-our-stir-bespeak-normalcy-wavelet-spitz-alsatian-miami-gizmo-sibling-riflemen-fugal-caiman-guy-tern-flick-nearer-dow-patch-grudge-prawn-debuting-scorch-brunei-waif-hibachi-beijing-tweet-share-homeward-ratline-postal-dissent-tigris-baldpate-clumsy-centre
Paste it into the password field and confirm that it's truncated to 255:
glom-our-stir-bespeak-normalcy-wavelet-spitz-alsatian-miami-gizmo-sibling-riflemen-fugal-caiman-guy-tern-flick-nearer-dow-patch-grudge-prawn-debuting-scorch-brunei-waif-hibachi-beijing-tweet-share-homeward-ratline-postal-dissent-tigris-baldpate-clumsy-cen
Save and check that the password work on the frontend to unlock the post.