Make WordPress Core

Changeset 58138

Timestamp:
05/13/2024 01:32:19 PM (3 months ago)
Author:
johnbillion
Message:

Bootstrap/Load: Update the domain parsing when initialising the cookie domain on Multisite.

This ensures the cookie domain is set to the bare domain without a port number, if one is present.

Props spacedmonkey

Fixes #21077

File:
1 edited

Legend:

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

    r56219 r58138  
    308308            return;
    309309        }
    310 
    311         $this->cookie_domain = $this->domain;
     310        $domain              = parse_url( $this->domain, PHP_URL_HOST );
     311        $this->cookie_domain = $this->domain;
    312312        if ( str_starts_with( $this->cookie_domain, 'www.' ) ) {
    313313            $this->cookie_domain = substr( $this->cookie_domain, 4 );
Note: See TracChangeset for help on using the changeset viewer.