Changeset 29200
- Timestamp:
- 07/16/2014 10:34:18 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/ms-default-constants.php
r26120 r29200 115 115 * 116 116 * @since 3.0.0 117 * 118 * @global boolean $subdomain_error 119 * @global boolean $subdomain_error_warn 117 120 */ 118 121 function ms_subdomain_constants() { 119 static $error = null; 120 static $error_warn = false; 122 global $subdomain_error, $subdomain_error_warn; 121 123 122 if ( false === $ error )124 if ( false === $subdomain_error ) { 123 125 return; 126 } 124 127 125 if ( $ error ) {128 if ( $subdomain_error ) { 126 129 $vhost_deprecated = __( 'The constant <code>VHOST</code> <strong>is deprecated</strong>. Use the boolean constant <code>SUBDOMAIN_INSTALL</code> in wp-config.php to enable a subdomain configuration. Use is_subdomain_install() to check whether a subdomain configuration is enabled.' ); 127 if ( $ error_warn ) {130 if ( $subdomain_error_warn ) { 128 131 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 ); 129 132 } else { … … 134 137 135 138 if ( defined( 'SUBDOMAIN_INSTALL' ) && defined( 'VHOST' ) ) { 136 if ( SUBDOMAIN_INSTALL == ( 'yes' == VHOST ) ) { 137 $error = true; 138 } else { 139 $error = $error_warn = true; 139 $subdomain_error = true; 140 if ( SUBDOMAIN_INSTALL !== ( 'yes' == VHOST ) ) { 141 $subdomain_error_warn = true; 140 142 } 141 143 } elseif ( defined( 'SUBDOMAIN_INSTALL' ) ) { 144 $subdomain_error = false; 142 145 define( 'VHOST', SUBDOMAIN_INSTALL ? 'yes' : 'no' ); 143 146 } elseif ( defined( 'VHOST' ) ) { 144 $ error = true;147 $subdomain_error = true; 145 148 define( 'SUBDOMAIN_INSTALL', 'yes' == VHOST ); 146 149 } else { 150 $subdomain_error = false; 147 151 define( 'SUBDOMAIN_INSTALL', false ); 148 152 define( 'VHOST', 'no' ); -
trunk/tests/phpunit/tests/ms.php
r28943 r29200 24 24 parent::tearDown(); 25 25 $wpdb->suppress_errors( $this->suppress ); 26 } 27 28 /** 29 * @ticket 28697 30 */ 31 function test_ms_subdomain_constants() { 32 global $subdomain_error; 33 34 $this->assertFalse( $subdomain_error ); 35 ms_subdomain_constants(); 36 $this->assertFalse( $subdomain_error ); 26 37 } 27 38
Note: See TracChangeset
for help on using the changeset viewer.