Skip to content

Commit

Permalink
General: Ensure duplicated keys existence before validation
Browse files Browse the repository at this point in the history
Adds array key existence check to prevent undefined index warnings.
  • Loading branch information
Infinite-Null committed Nov 14, 2024
1 parent 7b29414 commit 829241d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/wp-includes/pluggable.php
Original file line number Diff line number Diff line change
Expand Up @@ -2514,7 +2514,8 @@ function wp_salt( $scheme = 'auth' ) {
foreach ( array( 'auth', 'secure_auth', 'logged_in', 'nonce' ) as $key ) {
foreach ( array( 'key', 'salt' ) as $second ) {
$const = strtoupper( "{$key}_{$second}" );
if ( ! defined( $const ) || true === $duplicated_keys[ constant( $const ) ] ) {

if ( ! defined( $const ) || ( isset( $duplicated_keys[ constant( $const ) ] ) && true === $duplicated_keys[ constant( $const ) ] ) ) {
$options_to_prime[] = "{$key}_{$second}";
}
}
Expand Down

0 comments on commit 829241d

Please sign in to comment.