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].

Reviewed by davidbaumwald.
Merges [59427] to the 6.7 branch.

Props juliobox, ankitkumarshah, dilipbheda, johnbillion, joemcgill, desrosj.
Fixes #62424.
Built from https://develop.svn.wordpress.org/branches/6.7@59434


git-svn-id: http://core.svn.wordpress.org/branches/6.7@58820 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
desrosj 2024-11-20 13:53:13 +00:00
parent 85d63dedf1
commit fe0244083a
2 changed files with 11 additions and 11 deletions

View File

@ -2479,16 +2479,7 @@ if ( ! function_exists( 'wp_salt' ) ) :
static $duplicated_keys;
if ( null === $duplicated_keys ) {
$duplicated_keys = array(
'put your unique phrase here' => true,
);
/*
* translators: This string should only be translated if wp-config-sample.php is localized.
* You can check the localized release package or
* https://i18n.svn.wordpress.org/<locale code>/branches/<wp version>/dist/wp-config-sample.php
*/
$duplicated_keys[ __( 'put your unique phrase here' ) ] = true;
$duplicated_keys = array();
foreach ( array( 'AUTH', 'SECURE_AUTH', 'LOGGED_IN', 'NONCE', 'SECRET' ) as $first ) {
foreach ( array( 'KEY', 'SALT' ) as $second ) {
@ -2499,6 +2490,15 @@ if ( ! function_exists( 'wp_salt' ) ) :
$duplicated_keys[ $value ] = isset( $duplicated_keys[ $value ] );
}
}
$duplicated_keys['put your unique phrase here'] = true;
/*
* translators: This string should only be translated if wp-config-sample.php is localized.
* You can check the localized release package or
* https://i18n.svn.wordpress.org/<locale code>/branches/<wp version>/dist/wp-config-sample.php
*/
$duplicated_keys[ __( 'put your unique phrase here' ) ] = true;
}
/*

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.7.1-alpha-59433';
$wp_version = '6.7.1-alpha-59434';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.