Make WordPress Core

Changeset 55433


Ignore:
Timestamp:
02/28/2023 01:20:04 PM (20 months ago)
Author:
SergeyBiryukov
Message:

Users: Adjust the initialization of the $duplicated_keys array in wp_salt().

This avoids an endless loop if get_current_user_id() is used in a callback attached to the gettext filter.

With the translated phrase moved into a separate assignment, the function succeeds in setting the static $duplicated_keys array once and no longer goes into this code section on subsequent calls.

Follow-up to [54249].

Props adityaarora010196, SergeyBiryukov.
Fixes #57121.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/pluggable.php

    r55308 r55433  
    24182418        if ( null === $duplicated_keys ) {
    24192419            $duplicated_keys = array(
    2420                 'put your unique phrase here'       => true,
    2421                 /*
    2422                  * translators: This string should only be translated if wp-config-sample.php is localized.
    2423                  * You can check the localized release package or
    2424                  * https://i18n.svn.wordpress.org/<locale code>/branches/<wp version>/dist/wp-config-sample.php
    2425                  */
    2426                 __( 'put your unique phrase here' ) => true,
     2420                'put your unique phrase here' => true,
    24272421            );
     2422
     2423            /*
     2424             * translators: This string should only be translated if wp-config-sample.php is localized.
     2425             * You can check the localized release package or
     2426             * https://i18n.svn.wordpress.org/<locale code>/branches/<wp version>/dist/wp-config-sample.php
     2427             */
     2428            $duplicated_keys[ __( 'put your unique phrase here' ) ] = true;
     2429
    24282430            foreach ( array( 'AUTH', 'SECURE_AUTH', 'LOGGED_IN', 'NONCE', 'SECRET' ) as $first ) {
    24292431                foreach ( array( 'KEY', 'SALT' ) as $second ) {
Note: See TracChangeset for help on using the changeset viewer.