Make WordPress Core

Ticket #39386: 39386.patch

File 39386.patch, 1.0 KB (added by johnbillion, 7 years ago)
  • src/wp-includes/default-constants.php

     
    247247        /**
    248248         * @since 1.2.0
    249249         */
    250         if ( !defined('COOKIEPATH') )
    251                 define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('home') . '/' ) );
     250        if ( ! defined( 'COOKIEPATH' ) ) {
     251                $home = get_option( 'home' );
     252                if ( ! $home ) {
     253                        $home = wp_guess_url();
     254                }
     255                define( 'COOKIEPATH', preg_replace( '|https?://[^/]+|i', '', $home . '/' ) );
     256        }
    252257
    253258        /**
    254259         * @since 1.5.0
    255260         */
    256         if ( !defined('SITECOOKIEPATH') )
    257                 define('SITECOOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('siteurl') . '/' ) );
     261        if ( ! defined( 'SITECOOKIEPATH' ) ) {
     262                $siteurl = get_option( 'siteurl' );
     263                if ( ! $siteurl ) {
     264                        $siteurl = wp_guess_url();
     265                }
     266                define( 'SITECOOKIEPATH', preg_replace( '|https?://[^/]+|i', '', $siteurl . '/' ) );
     267        }
    258268
    259269        /**
    260270         * @since 2.6.0