Make WordPress Core


Ignore:
Timestamp:
04/24/2008 12:19:09 AM (17 years ago)
Author:
ryan
Message:

Add length arg to wp_generate_password() and lengthen secret. Props tellyworth. fixes #6146 for trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/pluggable.php

    r7747 r7796  
    11681168 * @return string The random password
    11691169 **/
    1170 function wp_generate_password() {
    1171     $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
    1172     $length = 7;
     1170function wp_generate_password($length = 12) {
     1171    $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()";
    11731172    $password = '';
    11741173    for ( $i = 0; $i < $length; $i++ )
    1175         $password .= substr($chars, mt_rand(0, 61), 1);
     1174        $password .= substr($chars, mt_rand(0, strlen($chars)), 1);
    11761175    return $password;
    11771176}
Note: See TracChangeset for help on using the changeset viewer.