Ticket #11796: 11796.3.diff
| File 11796.3.diff, 5.9 KB (added by , 16 years ago) |
|---|
-
wp-admin/network.php
237 237 echo '<div class="error">' . $errors->get_error_message() . '</div>'; 238 238 239 239 if ( $_POST ) { 240 $ vhost= !allow_subdomain_install() ? false : (bool) $_POST['subdomain_install'];240 $subdomain_install = !allow_subdomain_install() ? false : (bool) $_POST['subdomain_install']; 241 241 } else { 242 242 if ( is_multisite() ) { 243 $ vhost= is_subdomain_install();243 $subdomain_install = is_subdomain_install(); 244 244 ?> 245 245 <div class="updated"><p><strong><?php _e( 'Notice: The Network feature is already enabled.' ); ?></strong> <?php _e( 'The original configuration steps are shown here for reference.' ); ?></p></div> 246 246 <?php } else { 247 $ vhost= (bool) $wpdb->get_var( "SELECT meta_value FROM $wpdb->sitemeta WHERE site_id = 1 AND meta_key = 'subdomain_install'" );247 $subdomain_install = (bool) $wpdb->get_var( "SELECT meta_value FROM $wpdb->sitemeta WHERE site_id = 1 AND meta_key = 'subdomain_install'" ); 248 248 ?> 249 249 <div class="error"><p><strong><?php _e('Warning:'); ?></strong> <?php _e( 'An existing WordPress network was detected.' ); ?></p></div> 250 250 <p><?php _e( 'Please complete the configuration steps. To create a new network, you will need to empty or remove the network database tables.' ); ?></p> … … 265 265 <li><p><?php printf( __( 'Add the following to your <code>wp-config.php</code> file in <code>%s</code> <strong>above</strong> the line reading <code>/* That’s all, stop editing! Happy blogging. */</code>:' ), ABSPATH ); ?></p> 266 266 <textarea class="code" readonly="readonly" cols="100" rows="7"> 267 267 define( 'MULTISITE', true ); 268 define( ' VHOST', '<?php echo $vhost ? 'yes' : 'no'; ?>' );268 define( 'SUBDOMAIN_INSTALL', 'false' ); 269 269 $base = '<?php echo $base; ?>'; 270 270 define( 'DOMAIN_CURRENT_SITE', '<?php echo $hostname; ?>' ); 271 271 define( 'PATH_CURRENT_SITE', '<?php echo $base; ?>' ); … … 309 309 RewriteRule ^index\.php$ - [L] 310 310 311 311 # uploaded files 312 RewriteRule ^' . ( $ vhost ? '' : '([_0-9a-zA-Z-]+/)?' ) . 'files/(.+) wp-includes/ms-files.php?file=$' . ( $vhost? 1 : 2 ) . ' [L]' . "\n";312 RewriteRule ^' . ( $subdomain_install ? '' : '([_0-9a-zA-Z-]+/)?' ) . 'files/(.+) wp-includes/ms-files.php?file=$' . ( $subdomain_install ? 1 : 2 ) . ' [L]' . "\n"; 313 313 314 if ( ! $ vhost)314 if ( ! $subdomain_install ) 315 315 $htaccess_file .= "\n# add a trailing slash to /wp-admin\n" . 'RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]' . "\n"; 316 316 317 317 $htaccess_file .= "\n" . 'RewriteCond %{REQUEST_FILENAME} -f [OR] … … 319 319 RewriteRule ^ - [L]'; 320 320 321 321 // @todo custom content dir. 322 if ( ! $ vhost)322 if ( ! $subdomain_install ) 323 323 $htaccess_file .= "\n" . 'RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L] 324 324 RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]'; 325 325 … … 327 327 328 328 ?> 329 329 <li><p><?php printf( __( 'Add the following to your <code>.htaccess</code> file in <code>%s</code>, replacing other WordPress rules:' ), ABSPATH ); ?></p> 330 <textarea class="code" readonly="readonly" cols="100" rows="<?php echo $ vhost? 11 : 16; ?>">330 <textarea class="code" readonly="readonly" cols="100" rows="<?php echo $subdomain_install ? 11 : 16; ?>"> 331 331 <?php echo wp_htmledit_pre( $htaccess_file ); ?> 332 332 </textarea></li> 333 333 </ol> -
wp-includes/ms-default-constants.php
90 90 */ 91 91 if ( !defined( 'WPMU_ACCEL_REDIRECT' ) ) 92 92 define( 'WPMU_ACCEL_REDIRECT', false ); 93 } 94 ?> 93 94 /** 95 * Handling the deprecated VHOST constant. 96 * @since 3.0.0 97 */ 98 if ( defined( 'VHOST' ) ) 99 $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.' ); 100 if ( defined( 'SUBDOMAIN_INSTALL' ) && defined( 'VHOST' ) ) { 101 if ( SUBDOMAIN_INSTALL == ( 'yes' == VHOST ) ) { 102 _deprecated_argument( 'define()', '3.0', $vhost_deprecated ); 103 } else { 104 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 ); 105 } 106 } elseif ( defined( 'SUBDOMAIN_INSTALL' ) ) { 107 define( 'VHOST', SUBDOMAIN_INSTALL ? 'yes' : 'no' ); 108 } elseif ( defined( 'VHOST' ) ) { 109 _deprecated_argument( 'define()', '3.0', $vhost_deprecated ); 110 define( 'SUBDOMAIN_INSTALL', 'yes' == VHOST ); 111 } else { 112 define( 'SUBDOMAIN_INSTALL', false ); 113 define( 'VHOST', 'no' ); 114 } 115 ?> 116 No newline at end of file -
wp-includes/ms-load.php
8 8 * @subpackage Multisite 9 9 */ 10 10 11 wp_default_constants( 'subdomain_install' ); 11 12 /** 12 13 * Whether a subdomain configuration is enabled. 13 14 * … … 16 17 * @return bool True if subdomain configuration is enabled, false otherwise. 17 18 */ 18 19 function is_subdomain_install() { 19 if ( defined('VHOST') && VHOST == 'yes' ) 20 return true; 21 22 return false; 20 return SUBDOMAIN_INSTALL; 23 21 } 24 22 25 23 /** -
wp-includes/wp-db.php
575 575 foreach ( $this->tables( 'global' ) as $table => $prefixed_table ) 576 576 $this->$table = $prefixed_table; 577 577 578 if ( defined( 'VHOST') && empty( $this->blogid ) )578 if ( is_multisite() && empty( $this->blogid ) ) 579 579 return $old_prefix; 580 580 581 581 $this->prefix = $this->get_blog_prefix();