Ticket #19599: 19599.4.patch

File 19599.4.patch, 1.9 KB (added by SergeyBiryukov, 4 months ago)
  • wp-includes/default-constants.php

     
    140140 * @since 3.0.0 
    141141 */ 
    142142function wp_cookie_constants( ) { 
    143         global $wp_default_secret_key; 
    144  
    145143        /** 
    146144         * Used to guarantee unique hash cookies 
    147145         * @since 1.5 
     
    155153        } 
    156154 
    157155        /** 
    158          * Should be exactly the same as the default value of SECRET_KEY in wp-config-sample.php 
    159          * @since 2.5.0 
    160          */ 
    161         $wp_default_secret_key = 'put your unique phrase here'; 
    162  
    163         /** 
    164156         * @since 2.0.0 
    165157         */ 
    166158        if ( !defined('USER_COOKIE') ) 
  • wp-includes/pluggable.php

     
    13131313 * @return string Salt value 
    13141314 */ 
    13151315function wp_salt($scheme = 'auth') { 
    1316         global $wp_default_secret_key; 
     1316        $secret_keys = array(); 
     1317 
     1318        if ( defined( 'AUTH_KEY' ) ) 
     1319                $secret_keys[] = AUTH_KEY; 
     1320        if ( defined( 'SECURE_AUTH_KEY' ) ) 
     1321                $secret_keys[] = SECURE_AUTH_KEY; 
     1322        if ( defined( 'LOGGED_IN_KEY' ) ) 
     1323                $secret_keys[] = LOGGED_IN_KEY; 
     1324        if ( defined( 'NONCE_KEY' ) ) 
     1325                $secret_keys[] = NONCE_KEY; 
     1326        if ( defined( 'AUTH_SALT' ) ) 
     1327                $secret_keys[] = AUTH_SALT; 
     1328        if ( defined( 'SECURE_AUTH_SALT' ) ) 
     1329                $secret_keys[] = SECURE_AUTH_SALT; 
     1330        if ( defined( 'LOGGED_IN_SALT' ) ) 
     1331                $secret_keys[] = LOGGED_IN_SALT; 
     1332        if ( defined( 'NONCE_SALT' ) ) 
     1333                $secret_keys[] = NONCE_SALT; 
     1334 
     1335        $wp_default_secret_key = ''; 
     1336        $secret_keys_diff = array_diff_assoc( $secret_keys, array_unique( $secret_keys ) ); 
     1337        if ( !empty( $secret_keys_diff ) ) 
     1338                $wp_default_secret_key = array_shift( $secret_keys_diff ); 
     1339 
    13171340        $secret_key = ''; 
    13181341        if ( defined('SECRET_KEY') && ('' != SECRET_KEY) && ( $wp_default_secret_key != SECRET_KEY) ) 
    13191342                $secret_key = SECRET_KEY;