Opened 2 years ago
Closed 3 days ago
#21243 closed enhancement (fixed)
move password hint text to a function
Reported by: | convissor | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 4.1 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Users | Keywords: | has-patch commit |
Focuses: | docs | Cc: |
Description
The password hint text, noted below, is hard coded in four places:
wp-admin/install.php wp-admin/user-edit.php wp-admin/user-new.php wp-login.php
Hint: The password should be at least seven characters long. To make it stronger, use upper and lower case letters, numbers and symbols like ! " ? $ % ^ & ).
This approach is prone to mistakes when changes are made. In addition, plugins that want to override the text need to use the resource intensive and clumsy gettext filter.
Per nacin and westi, the attached patch moves the text to a function (wp_password_hint()) in wp-includes/user.php and adds a filter (password_hint).
Attachments (7)
Change History (20)
SergeyBiryukov — 2 years ago
comment:1 SergeyBiryukov — 2 years ago
- Keywords has-patch added
voldemortensen — 3 weeks ago
comment:3 voldemortensen — 3 weeks ago
+1 for this. Refreshed patch.
comment:4 convissor — 3 weeks ago
The minor grammar change in #26457 / r27246 "breaking" Login Security Solution reaffirms the need for this patch.
comment:5 ircbot — 3 weeks ago
This ticket was mentioned in IRC in #wordpress-dev by DanielConvissor. View the logs.
comment:6 SergeyBiryukov — 3 weeks ago
- Focuses docs added
- Milestone changed from Awaiting Review to 4.1
The filter needs to be documented as per the documentation standards.
comment:7 SergeyBiryukov — 12 days ago
- Component changed from General to Users
- Keywords commit added
comment:8 SergeyBiryukov — 11 days ago
- Owner set to SergeyBiryukov
- Resolution set to fixed
- Status changed from new to closed
In 29962:
comment:9 follow-up: ↓ 11 SergeyBiryukov — 11 days ago
- Resolution fixed deleted
- Status changed from closed to reopened
Let's rename the function to _wp_get_password_hint(), for consistency with other functions like _wp_get_user_contactmethods() or _get_additional_user_keys().
comment:10 Ankit K Gupta — 10 days ago
Updated the function name for make consistency with other functions.
comment:11 in reply to: ↑ 9 ; follow-up: ↓ 12 ramiy — 10 days ago
Replying to SergeyBiryukov:
Let's rename the function to _wp_get_password_hint(), for consistency with other functions like _wp_get_user_contactmethods() or _get_additional_user_keys().
Sergey,
why not use a shorter name _get_password_hint() ?
comment:12 in reply to: ↑ 11 Ankit K Gupta — 4 days ago
Replying to ramiy:
Replying to SergeyBiryukov:
Let's rename the function to _wp_get_password_hint(), for consistency with other functions like _wp_get_user_contactmethods() or _get_additional_user_keys().
Sergey,
why not use a shorter name _get_password_hint() ?
We can use this. It is based on our choice. Let me know, what is the issue with longer name of the function ?
comment:13 johnbillion — 3 days ago
- Resolution set to fixed
- Status changed from reopened to closed
In 30033:
It would probably make sense to mark the function as private (21243.2.diff), similarly to _wp_get_user_contactmethods().