Make WordPress Core


Ignore:
Timestamp:
11/30/2017 11:09:33 PM (7 years ago)
Author:
pento
Message:

Code is Poetry.
WordPress' code just... wasn't.
This is now dealt with.

Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS.
Fixes #41057.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/ms-default-constants.php

    r41661 r42343  
    2020    add_filter( 'default_site_option_ms_files_rewriting', '__return_true' );
    2121
    22     if ( ! get_site_option( 'ms_files_rewriting' ) )
     22    if ( ! get_site_option( 'ms_files_rewriting' ) ) {
    2323        return;
     24    }
    2425
    2526    // Base uploads dir relative to ABSPATH
    26     if ( !defined( 'UPLOADBLOGSDIR' ) )
     27    if ( ! defined( 'UPLOADBLOGSDIR' ) ) {
    2728        define( 'UPLOADBLOGSDIR', 'wp-content/blogs.dir' );
     29    }
    2830
    2931    // Note, the main site in a post-MU network uses wp-content/uploads.
     
    3537
    3638        // Uploads dir relative to ABSPATH
    37         if ( 'wp-content/blogs.dir' == UPLOADBLOGSDIR && ! defined( 'BLOGUPLOADDIR' ) )
     39        if ( 'wp-content/blogs.dir' == UPLOADBLOGSDIR && ! defined( 'BLOGUPLOADDIR' ) ) {
    3840            define( 'BLOGUPLOADDIR', WP_CONTENT_DIR . '/blogs.dir/' . $site_id . '/files/' );
     41        }
    3942    }
    4043}
     
    4548 * @since 3.0.0
    4649 */
    47 function ms_cookie_constants(  ) {
     50function ms_cookie_constants() {
    4851    $current_network = get_network();
    4952
     
    5154     * @since 1.2.0
    5255     */
    53     if ( !defined( 'COOKIEPATH' ) )
     56    if ( ! defined( 'COOKIEPATH' ) ) {
    5457        define( 'COOKIEPATH', $current_network->path );
     58    }
    5559
    5660    /**
    5761     * @since 1.5.0
    5862     */
    59     if ( !defined( 'SITECOOKIEPATH' ) )
     63    if ( ! defined( 'SITECOOKIEPATH' ) ) {
    6064        define( 'SITECOOKIEPATH', $current_network->path );
     65    }
    6166
    6267    /**
    6368     * @since 2.6.0
    6469     */
    65     if ( !defined( 'ADMIN_COOKIE_PATH' ) ) {
     70    if ( ! defined( 'ADMIN_COOKIE_PATH' ) ) {
    6671        if ( ! is_subdomain_install() || trim( parse_url( get_option( 'siteurl' ), PHP_URL_PATH ), '/' ) ) {
    6772            define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH );
     
    7479     * @since 2.0.0
    7580     */
    76     if ( !defined('COOKIE_DOMAIN') && is_subdomain_install() ) {
    77         if ( !empty( $current_network->cookie_domain ) )
    78             define('COOKIE_DOMAIN', '.' . $current_network->cookie_domain);
    79         else
    80             define('COOKIE_DOMAIN', '.' . $current_network->domain);
     81    if ( ! defined( 'COOKIE_DOMAIN' ) && is_subdomain_install() ) {
     82        if ( ! empty( $current_network->cookie_domain ) ) {
     83            define( 'COOKIE_DOMAIN', '.' . $current_network->cookie_domain );
     84        } else {
     85            define( 'COOKIE_DOMAIN', '.' . $current_network->domain );
     86        }
    8187    }
    8288}
     
    9399    /**
    94100     * Optional support for X-Sendfile header
     101     *
    95102     * @since 3.0.0
    96103     */
    97     if ( !defined( 'WPMU_SENDFILE' ) )
     104    if ( ! defined( 'WPMU_SENDFILE' ) ) {
    98105        define( 'WPMU_SENDFILE', false );
     106    }
    99107
    100108    /**
    101109     * Optional support for X-Accel-Redirect header
     110     *
    102111     * @since 3.0.0
    103112     */
    104     if ( !defined( 'WPMU_ACCEL_REDIRECT' ) )
     113    if ( ! defined( 'WPMU_ACCEL_REDIRECT' ) ) {
    105114        define( 'WPMU_ACCEL_REDIRECT', false );
     115    }
    106116}
    107117
     
    120130 */
    121131function ms_subdomain_constants() {
    122     static $subdomain_error = null;
     132    static $subdomain_error      = null;
    123133    static $subdomain_error_warn = null;
    124134
     
    139149            trigger_error( __( '<strong>Conflicting values for the constants VHOST and SUBDOMAIN_INSTALL.</strong> The value of SUBDOMAIN_INSTALL will be assumed to be your subdomain configuration setting.' ) . ' ' . $vhost_deprecated, E_USER_WARNING );
    140150        } else {
    141             _deprecated_argument( 'define()', '3.0.0', $vhost_deprecated );
     151            _deprecated_argument( 'define()', '3.0.0', $vhost_deprecated );
    142152        }
    143153        return;
Note: See TracChangeset for help on using the changeset viewer.