WordPress.org

Make WordPress Core

Changeset 7796


Ignore:
Timestamp:
04/24/08 00:19:09 (6 years ago)
Author:
ryan
Message:

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

Location:
trunk
Files:
4 edited

Legend:

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

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

    r7658 r7796  
    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(); 
     
    722725    } 
    723726     
     727} 
     728 
     729function upgrade_251() { 
     730    global $wp_current_db_version; 
     731 
     732    // Make the secret longer 
     733    update_option('secret', wp_generate_password(64)); 
    724734} 
    725735 
  • 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} 
  • trunk/wp-includes/version.php

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