WordPress.org

Make WordPress Core

Changeset 7837


Ignore:
Timestamp:
04/25/2008 05:12:56 PM (10 years ago)
Author:
ryan
Message:

Add arg to make special chars optional when generating passwords. fixes #6842 for 2.5

Location:
branches/2.5
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2.5/wp-includes/pluggable.php

    r7822 r7837  
    11691169 * @return string The random password
    11701170 **/
    1171 function wp_generate_password($length = 12) {
    1172     $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()";
     1171function wp_generate_password($length = 12, $special_chars = true) {
     1172    $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
     1173    if ( $special_chars )
     1174        $chars .= '!@#$%^&*()';
     1175
    11731176    $password = '';
    11741177    for ( $i = 0; $i < $length; $i++ )
  • branches/2.5/wp-login.php

    r7632 r7837  
    9494    if ( empty($key) ) {
    9595        // Generate something random for a key...
    96         $key = wp_generate_password();
     96        $key = wp_generate_password(20, false);
    9797        do_action('retrieve_password_key', $user_login, $key);
    9898        // Now insert the new md5 key into the db
Note: See TracChangeset for help on using the changeset viewer.