@@ -1159,10 +1159,10 @@ function wp_verify_nonce($nonce, $action = -1) {
11591159 $ i = wp_nonce_tick ();
11601160
11611161 // Nonce generated 0-12 hours ago
1162- if ( substr (wp_hash ($ i . $ action . $ uid ), -12 , 10 ) == $ nonce )
1162+ if ( substr (wp_hash ($ i . $ action . $ uid, ' nonce ' ), -12 , 10 ) == $ nonce )
11631163 return 1 ;
11641164 // Nonce generated 12-24 hours ago
1165- if ( substr (wp_hash (($ i - 1 ) . $ action . $ uid ), -12 , 10 ) == $ nonce )
1165+ if ( substr (wp_hash (($ i - 1 ) . $ action . $ uid, ' nonce ' ), -12 , 10 ) == $ nonce )
11661166 return 2 ;
11671167 // Invalid nonce
11681168 return false ;
@@ -1184,7 +1184,7 @@ function wp_create_nonce($action = -1) {
11841184
11851185 $ i = wp_nonce_tick ();
11861186
1187- return substr (wp_hash ($ i . $ action . $ uid ), -12 , 10 );
1187+ return substr (wp_hash ($ i . $ action . $ uid, ' nonce ' ), -12 , 10 );
11881188}
11891189endif ;
11901190
@@ -1272,6 +1272,19 @@ function wp_salt($scheme = 'auth') {
12721272 update_option ('logged_in_salt ' , $ salt );
12731273 }
12741274 }
1275+ } elseif ( 'nonce ' == $ scheme ) {
1276+ if ( defined ('NONCE_KEY ' ) && ('' != NONCE_KEY ) && ( $ wp_default_secret_key != NONCE_KEY ) )
1277+ $ secret_key = NONCE_KEY ;
1278+
1279+ if ( defined ('NONCE_SALT ' ) ) {
1280+ $ salt = NONCE_SALT ;
1281+ } else {
1282+ $ salt = get_option ('nonce_salt ' );
1283+ if ( empty ($ salt ) ) {
1284+ $ salt = wp_generate_password ();
1285+ update_option ('nonce_salt ' , $ salt );
1286+ }
1287+ }
12751288 } else {
12761289 // ensure each auth scheme has its own unique salt
12771290 $ salt = hash_hmac ('md5 ' , $ scheme , $ secret_key );
0 commit comments