diff -r c7c34916027a -r 177826044cd9 wp/wp-includes/ms-default-constants.php --- a/wp/wp-includes/ms-default-constants.php Mon Oct 14 18:06:33 2019 +0200 +++ b/wp/wp-includes/ms-default-constants.php Mon Oct 14 18:28:13 2019 +0200 @@ -19,12 +19,14 @@ // This filter is attached in ms-default-filters.php but that file is not included during SHORTINIT. add_filter( 'default_site_option_ms_files_rewriting', '__return_true' ); - if ( ! get_site_option( 'ms_files_rewriting' ) ) + if ( ! get_site_option( 'ms_files_rewriting' ) ) { return; + } // Base uploads dir relative to ABSPATH - if ( !defined( 'UPLOADBLOGSDIR' ) ) + if ( ! defined( 'UPLOADBLOGSDIR' ) ) { define( 'UPLOADBLOGSDIR', 'wp-content/blogs.dir' ); + } // Note, the main site in a post-MU network uses wp-content/uploads. // This is handled in wp_upload_dir() by ignoring UPLOADS for this case. @@ -34,8 +36,9 @@ define( 'UPLOADS', UPLOADBLOGSDIR . '/' . $site_id . '/files/' ); // Uploads dir relative to ABSPATH - if ( 'wp-content/blogs.dir' == UPLOADBLOGSDIR && ! defined( 'BLOGUPLOADDIR' ) ) + if ( 'wp-content/blogs.dir' == UPLOADBLOGSDIR && ! defined( 'BLOGUPLOADDIR' ) ) { define( 'BLOGUPLOADDIR', WP_CONTENT_DIR . '/blogs.dir/' . $site_id . '/files/' ); + } } } @@ -44,25 +47,27 @@ * * @since 3.0.0 */ -function ms_cookie_constants( ) { +function ms_cookie_constants() { $current_network = get_network(); /** * @since 1.2.0 */ - if ( !defined( 'COOKIEPATH' ) ) + if ( ! defined( 'COOKIEPATH' ) ) { define( 'COOKIEPATH', $current_network->path ); + } /** * @since 1.5.0 */ - if ( !defined( 'SITECOOKIEPATH' ) ) + if ( ! defined( 'SITECOOKIEPATH' ) ) { define( 'SITECOOKIEPATH', $current_network->path ); + } /** * @since 2.6.0 */ - if ( !defined( 'ADMIN_COOKIE_PATH' ) ) { + if ( ! defined( 'ADMIN_COOKIE_PATH' ) ) { if ( ! is_subdomain_install() || trim( parse_url( get_option( 'siteurl' ), PHP_URL_PATH ), '/' ) ) { define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH ); } else { @@ -73,11 +78,12 @@ /** * @since 2.0.0 */ - if ( !defined('COOKIE_DOMAIN') && is_subdomain_install() ) { - if ( !empty( $current_network->cookie_domain ) ) - define('COOKIE_DOMAIN', '.' . $current_network->cookie_domain); - else - define('COOKIE_DOMAIN', '.' . $current_network->domain); + if ( ! defined( 'COOKIE_DOMAIN' ) && is_subdomain_install() ) { + if ( ! empty( $current_network->cookie_domain ) ) { + define( 'COOKIE_DOMAIN', '.' . $current_network->cookie_domain ); + } else { + define( 'COOKIE_DOMAIN', '.' . $current_network->domain ); + } } } @@ -92,17 +98,21 @@ function ms_file_constants() { /** * Optional support for X-Sendfile header + * * @since 3.0.0 */ - if ( !defined( 'WPMU_SENDFILE' ) ) + if ( ! defined( 'WPMU_SENDFILE' ) ) { define( 'WPMU_SENDFILE', false ); + } /** * Optional support for X-Accel-Redirect header + * * @since 3.0.0 */ - if ( !defined( 'WPMU_ACCEL_REDIRECT' ) ) + if ( ! defined( 'WPMU_ACCEL_REDIRECT' ) ) { define( 'WPMU_ACCEL_REDIRECT', false ); + } } /** @@ -119,7 +129,7 @@ * @staticvar bool $subdomain_error_warn */ function ms_subdomain_constants() { - static $subdomain_error = null; + static $subdomain_error = null; static $subdomain_error_warn = null; if ( false === $subdomain_error ) { @@ -138,7 +148,7 @@ if ( $subdomain_error_warn ) { trigger_error( __( 'Conflicting values for the constants VHOST and SUBDOMAIN_INSTALL. The value of SUBDOMAIN_INSTALL will be assumed to be your subdomain configuration setting.' ) . ' ' . $vhost_deprecated, E_USER_WARNING ); } else { - _deprecated_argument( 'define()', '3.0.0', $vhost_deprecated ); + _deprecated_argument( 'define()', '3.0.0', $vhost_deprecated ); } return; }