Make WordPress Core

Ticket #8647: pluggable-php.diff

File pluggable-php.diff, 1.6 KB (added by sivel, 16 years ago)

Modified wp_generate_password and updates to wp_salt to use 64 character special and additional special characters for secret-keys.

  • wp-includes/pluggable.php

     
    12421242                } else {
    12431243                        $salt = get_option('auth_salt');
    12441244                        if ( empty($salt) ) {
    1245                                 $salt = wp_generate_password();
     1245                                $salt = wp_generate_password(64, true, true);
    12461246                                update_option('auth_salt', $salt);
    12471247                        }
    12481248                }
     
    12551255                } else {
    12561256                        $salt = get_option('secure_auth_salt');
    12571257                        if ( empty($salt) ) {
    1258                                 $salt = wp_generate_password();
     1258                                $salt = wp_generate_password(64, true, true);
    12591259                                update_option('secure_auth_salt', $salt);
    12601260                        }
    12611261                }
     
    12681268                } else {
    12691269                        $salt = get_option('logged_in_salt');
    12701270                        if ( empty($salt) ) {
    1271                                 $salt = wp_generate_password();
     1271                                $salt = wp_generate_password(64, true, true);
    12721272                                update_option('logged_in_salt', $salt);
    12731273                        }
    12741274                }
     
    12811281                } else {
    12821282                        $salt = get_option('nonce_salt');
    12831283                        if ( empty($salt) ) {
    1284                                 $salt = wp_generate_password();
     1284                                $salt = wp_generate_password(64, true, true);
    12851285                                update_option('nonce_salt', $salt);
    12861286                        }
    12871287                }
     
    13961396 *
    13971397 * @return string The random password
    13981398 **/
    1399 function wp_generate_password($length = 12, $special_chars = true) {
     1399function wp_generate_password($length = 12, $special_chars = true, $extra_special_chars = false) {
    14001400        $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
    14011401        if ( $special_chars )
    14021402                $chars .= '!@#$%^&*()';
     1403        if ( $extra_special_chars )
     1404                $chars .= '-_ []{}<>~`+=,.;:/?|';
    14031405
    14041406        $password = '';
    14051407        for ( $i = 0; $i < $length; $i++ )