WordPress.org

Make WordPress Core

Changeset 7798


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

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

Location:
branches/2.5
Files:
4 edited

Legend:

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

    r7165 r7798  
    231231
    232232    // 2.0.3
    233     add_option('secret', wp_generate_password());
     233    add_option('secret', wp_generate_password(64));
    234234
    235235    // 2.1
  • branches/2.5/wp-admin/includes/upgrade.php

    r7629 r7798  
    202202    if ( $wp_current_db_version < 7499 )
    203203        upgrade_250();
     204
     205    if ( $wp_current_db_version < 7796 )
     206        upgrade_251();
    204207
    205208    maybe_disable_automattic_widgets();
     
    728731    }
    729732   
     733}
     734
     735function upgrade_251() {
     736    global $wp_current_db_version;
     737
     738    // Make the secret longer
     739    update_option('secret', wp_generate_password(64));
    730740}
    731741
  • branches/2.5/wp-includes/pluggable.php

    r7688 r7798  
    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}
  • branches/2.5/wp-includes/version.php

    r7583 r7798  
    1717 * @global int $wp_db_version
    1818 */
    19 $wp_db_version = 7583;
     19$wp_db_version = 7796;
    2020
    2121?>
Note: See TracChangeset for help on using the changeset viewer.