Make WordPress Core

Changeset 6478


Ignore:
Timestamp:
12/24/2007 06:34:12 AM (17 years ago)
Author:
ryan
Message:

Allow DB salt to be overridden by SECRET_SALT. Add a filter to wp_salt(). see #5367

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-config-sample.php

    r6471 r6478  
    1010// Change SECRET_KEY to a unique phrase.  You won't have to remember it later,
    1111// so make it long and complicated.  You can visit https://www.grc.com/passwords.htm
    12 // to get a phrase generated for you.
    13 define('SECRET_KEY', ''); // Change this to a unique phrase.
     12// to get a phrase generated for you, or just make something up.
     13define('SECRET_KEY', 'put your unique phrase here'); // Change this to a unique phrase.
    1414
    1515// You can have multiple installations in one database if you give each a unique prefix
  • trunk/wp-includes/pluggable.php

    r6471 r6478  
    701701function wp_salt() {
    702702
    703     if ( defined('SECRET_KEY') && '' != SECRET_KEY )
    704         return SECRET_KEY;
    705 
    706     $salt = get_option('secret');
    707     if ( empty($salt) ) {
    708         $salt = wp_generate_password();
    709         update_option('secret', $salt);
    710     }
    711 
    712     return $salt;
     703    $secret_key = '';
     704    if ( defined('SECRET_KEY') && ('' != SECRET_KEY) && ('put your unique phrase here' != SECRET_KEY) )
     705        $secret_key = SECRET_KEY;
     706
     707    if ( defined('SECRET_SALT') ) {
     708        $salt = SECRET_SALT;
     709    } else {
     710        $salt = get_option('secret');
     711        if ( empty($salt) ) {
     712            $salt = wp_generate_password();
     713            update_option('secret', $salt);
     714        }
     715    }
     716
     717    return apply_filters('salt', $salt);
    713718}
    714719endif;
Note: See TracChangeset for help on using the changeset viewer.