WordPress.org

Make WordPress Core

Ticket #8647: setup-config-php-secure-keys.2.diff

File setup-config-php-secure-keys.2.diff, 1.5 KB (added by sivel, 9 years ago)

Use wp_generate_password instead of the api

  • wp-admin/setup-config.php

     
    2929require_once('../wp-includes/compat.php');
    3030require_once('../wp-includes/functions.php');
    3131require_once('../wp-includes/classes.php');
     32require_once('../wp-includes/pluggable.php');
     33require_once('../wp-includes/plugin.php');
     34require_once('../wp-includes/cache.php');
     35require_once('../wp-includes/formatting.php');
     36wp_cache_init();
    3237
    3338if (!file_exists('../wp-config-sample.php'))
    3439        wp_die('Sorry, I need a wp-config-sample.php file to work from. Please re-upload this file from your WordPress installation.');
     
    171176                        case "define('DB_HOST'":
    172177                                fwrite($handle, str_replace("localhost", $dbhost, $line));
    173178                                break;
     179                        case "define('AUTH_KEY":
     180                                fwrite($handle, str_replace("put your unique phrase here", wp_generate_password(64,true,true), $line));
     181                                break;
     182                        case "define('SECURE_A":
     183                                fwrite($handle, str_replace("put your unique phrase here", wp_generate_password(64,true,true), $line));
     184                                break;
     185                        case "define('LOGGED_I":
     186                                fwrite($handle, str_replace("put your unique phrase here", wp_generate_password(64,true,true), $line));
     187                                break;
     188                        case "define('NONCE_KE":
     189                                fwrite($handle, str_replace("put your unique phrase here", wp_generate_password(64,true,true), $line));
     190                                break;
    174191                        case '$table_prefix  =':
    175192                                fwrite($handle, str_replace('wp_', $prefix, $line));
    176193                                break;