Skip to content

Commit

Permalink
Users: Set the default value of COOKIE_DOMAIN to an empty string.
Browse files Browse the repository at this point in the history
This matches the type expected by the `setcookie()` function for the `$domain` parameter, and resolves a fatal error if `strict_types` is enabled.

Reference: [https://www.php.net/setcookie PHP Manual: setcookie()].

Follow-up to [2725], [6434], [12732], [13062].

Props kmvan, rajinsharwar, jrf, desrosj, Cybr, nicolefurlan, oglekler, hellofromTonya, kirasong, chaion07, mukesh27.
Fixes #46550.

git-svn-id: https://develop.svn.wordpress.org/trunk@58011 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov committed Apr 16, 2024
1 parent 3b9aefb commit ca0260b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/wp-includes/default-constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -325,9 +325,10 @@ function wp_cookie_constants() {

/**
* @since 2.0.0
* @since 6.5.0 The value has changed from false to an empty string.
*/
if ( ! defined( 'COOKIE_DOMAIN' ) ) {
define( 'COOKIE_DOMAIN', false );
define( 'COOKIE_DOMAIN', '' );
}

if ( ! defined( 'RECOVERY_MODE_COOKIE' ) ) {
Expand Down

0 comments on commit ca0260b

Please sign in to comment.