[wp-trac] [WordPress Trac] #12687: automatically generate unique AUTH_KEY and other values

WordPress Trac wp-trac at lists.automattic.com
Wed Mar 24 15:37:21 UTC 2010


#12687: automatically generate unique AUTH_KEY and other values
-------------------------+--------------------------------------------------
 Reporter:  jdingman     |       Owner:             
     Type:  enhancement  |      Status:  new        
 Priority:  normal       |   Milestone:  Unassigned 
Component:  General      |     Version:             
 Severity:  normal       |    Keywords:  needs-patch
-------------------------+--------------------------------------------------

Comment(by aaroncampbell):

 Actyually, it looks like it already DOES do this.  in wp-admin/setup-
 config.php lines 195-206:
 {{{
         if ( $no_api || is_wp_error( $secret_keys ) ) {
                 $secret_keys = array();
                 require_once( ABSPATH . WPINC . '/pluggable.php' );
                 for ( $i = 0; $i < 8; $i++ ) {
                         $secret_keys[] = wp_generate_password( 64, true,
 true );
                 }
         } else {
                 $secret_keys = explode( "\n", wp_remote_retrieve_body(
 $secret_keys ) );
                 foreach ( $secret_keys as $k => $v ) {
                         $secret_keys[$k] = substr( $v, 28, 64 );
                 }
         }
         $key = 0;
 }}}
 Then later in lines 226-235:
 {{{
                         case "define('AUTH_KEY":
                         case "define('SECURE_A":
                         case "define('LOGGED_I":
                         case "define('NONCE_KE":
                         case "define('AUTH_SAL":
                         case "define('SECURE_A":
                         case "define('LOGGED_I":
                         case "define('NONCE_SA":
                                 $configFile[$line_num] = str_replace('put
 your unique phrase here', $secret_keys[$key++], $line );
                                 break;
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/12687#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list