[wp-trac] [WordPress Trac] #47092: Increase the usefullness of 'random_password' by adding additional parameters

WordPress Trac noreply at wordpress.org
Wed May 1 17:17:48 UTC 2019


#47092: Increase the usefullness of 'random_password' by adding additional
parameters
------------------------------------+-----------------------------
 Reporter:  roytanck                |      Owner:  (none)
     Type:  enhancement             |     Status:  new
 Priority:  normal                  |  Milestone:  Awaiting Review
Component:  Login and Registration  |    Version:
 Severity:  normal                  |   Keywords:
  Focuses:                          |
------------------------------------+-----------------------------
 In the wp_generate_password function, the output is run through the
 'random_password' hook. This allows other functions to modify or replace
 the generated password. But because the $special_chars and
 $extra_special_chars parameters are not passed to the hook, any hooked
 function does not know whether special chars are allowed.

 This limits the hooks usefulness, since wp_generate_password is also used
 to generate tokens that needs to be url-safe. By passing the two extra
 arguments along in the filter, hooked functions can respects these
 requirements.

 I realize wp_generate_password is a pluggable function, but I feel that
 using the hook is a much cleaner way to override/improve WP's password
 suggestions.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/47092>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list