Skip to content

Commit 9b62294

Browse files
committed
Options, Meta APIs: Ensure duplicate salts are properly flagged.
Improvements were made in 6.7 to ensure that salts stored in the database were primed more efficiently. The logic added to accomplish this suffered from an edge case where array indexes were unexpectedly missing when `wp_salt()` was called recursively. Follow up to [58837]. Props juliobox, ankitkumarshah, dilipbheda, johnbillion, joemcgill, desrosj. Fixes #62424. git-svn-id: https://develop.svn.wordpress.org/trunk@59427 602fd350-edb4-49c9-b593-d223f7449a82
1 parent e1d1493 commit 9b62294

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

src/wp-includes/pluggable.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2479,16 +2479,7 @@ function wp_salt( $scheme = 'auth' ) {
24792479

24802480
static $duplicated_keys;
24812481
if ( null === $duplicated_keys ) {
2482-
$duplicated_keys = array(
2483-
'put your unique phrase here' => true,
2484-
);
2485-
2486-
/*
2487-
* translators: This string should only be translated if wp-config-sample.php is localized.
2488-
* You can check the localized release package or
2489-
* https://i18n.svn.wordpress.org/<locale code>/branches/<wp version>/dist/wp-config-sample.php
2490-
*/
2491-
$duplicated_keys[ __( 'put your unique phrase here' ) ] = true;
2482+
$duplicated_keys = array();
24922483

24932484
foreach ( array( 'AUTH', 'SECURE_AUTH', 'LOGGED_IN', 'NONCE', 'SECRET' ) as $first ) {
24942485
foreach ( array( 'KEY', 'SALT' ) as $second ) {
@@ -2499,6 +2490,15 @@ function wp_salt( $scheme = 'auth' ) {
24992490
$duplicated_keys[ $value ] = isset( $duplicated_keys[ $value ] );
25002491
}
25012492
}
2493+
2494+
$duplicated_keys['put your unique phrase here'] = true;
2495+
2496+
/*
2497+
* translators: This string should only be translated if wp-config-sample.php is localized.
2498+
* You can check the localized release package or
2499+
* https://i18n.svn.wordpress.org/<locale code>/branches/<wp version>/dist/wp-config-sample.php
2500+
*/
2501+
$duplicated_keys[ __( 'put your unique phrase here' ) ] = true;
25022502
}
25032503

25042504
/*

0 commit comments

Comments
 (0)