Ticket #11796: 11796.diff
| File 11796.diff, 5.5 KB (added by , 16 years ago) |
|---|
-
wp-includes/ms-load.php
21 21 22 22 // Fix empty PHP_SELF 23 23 $PHP_SELF = $_SERVER['PHP_SELF']; 24 if ( empty($PHP_SELF) || ( empty($PHP_SELF) && constant( 'VHOST' ) == 'no'&& $current_blog->path != '/' ) )24 if ( empty($PHP_SELF) || ( empty($PHP_SELF) && !is_subdomain_install() && $current_blog->path != '/' ) ) 25 25 $_SERVER['PHP_SELF'] = $PHP_SELF = preg_replace("/(\?.*)?$/",'',$_SERVER["REQUEST_URI"]); 26 26 27 27 wp_cache_init(); // need to init cache again after blog_id is set -
wp-includes/ms-settings.php
1 1 <?php 2 2 3 3 /** 4 * Whether a subdomain configuration is enabled 4 * Whether a subdomain configuration is enabled. 5 5 * 6 * Interprets <code>define('VHOST', 'no')</code> as false for backwards compatability. 7 * 6 8 * @since 3.0 7 9 * 8 10 * @return bool True if subdomain configuration is enabled, false otherwise. 9 11 */ 10 12 function is_subdomain_install() { 11 if ( defined('VHOST') && VHOST == 'yes' )13 if ( defined('VHOST') && VHOST && VHOST != 'no' ) 12 14 return true; 13 15 14 16 return false; -
wp-admin/includes/schema.php
619 619 * 620 620 * @param int $network_id id of network to populate 621 621 */ 622 function populate_network( $network_id = 1, $domain = '', $email = '', $site_name = '', $path = '/', $vhost = 'no') {622 function populate_network( $network_id = 1, $domain = '', $email = '', $site_name = '', $path = '/', $vhost = false ) { 623 623 global $wpdb, $current_site, $wp_version, $wp_db_version, $wp_rewrite; 624 624 625 625 $msg = ''; … … 701 701 update_usermeta( $site_user->ID, 'primary_blog', 1 ); 702 702 } 703 703 704 if ( $vhost == 'yes' )704 if ( $vhost && $vhost != 'no' ) // 'no' for compat 705 705 update_option( 'permalink_structure', '/%year%/%monthnum%/%day%/%postname%/'); 706 706 else 707 707 update_option( 'permalink_structure', '/blog/%year%/%monthnum%/%day%/%postname%/'); 708 708 709 709 $wp_rewrite->flush_rules(); 710 710 711 if ( $vhost == 'yes' ) {711 if ( $vhost && $vhost != 'no' ) { // 'no' for compat 712 712 $vhost_ok = false; 713 713 $hostname = substr( md5( time() ), 0, 6 ) . '.' . $domain; // Very random hostname! 714 714 $page = wp_remote_get( 'http://' . $hostname, array( 'timeout' => 5, 'httpversion' => '1.1' ) ); -
wp-admin/includes/wp-config.ms
93 93 // remember to change WP_CONTENT too. 94 94 // define( "UPLOADBLOGSDIR", "fileserver" ); 95 95 96 // If VHOST is 'yes'uncomment and set this to a URL to redirect if a blog does not exist or is a 404 on the main blog. (Useful if signup is disabled)96 // If VHOST is true uncomment and set this to a URL to redirect if a blog does not exist or is a 404 on the main blog. (Useful if signup is disabled) 97 97 // For example, the browser will redirect to http://examples.com/ for the following: define( 'NOBLOGREDIRECT', 'http://example.com/' ); 98 98 // Set this value to %siteurl% to redirect to the root of the site 99 99 // define( 'NOBLOGREDIRECT', '' ); -
wp-admin/options-network.php
142 142 <p><strong>Note</strong> It looks like <code>mod_rewrite</code> is not installed.</p> 143 143 <?php } ?> 144 144 <p class="blog-address"> 145 <label><input type='radio' name='vhost' value=' yes' <?php if( $rewrite_enabled ) echo 'checked="checked"'; ?> /> Sub-domains (like <code>blog1.example.com</code>)</label><br />146 <label><input type='radio' name='vhost' value=' no' <?php if( !$rewrite_enabled ) echo 'checked="checked"'; ?> /> Sub-directories (like <code>example.com/blog1</code>)</label>145 <label><input type='radio' name='vhost' value='1' <?php if( $rewrite_enabled ) echo 'checked="checked"'; ?> /> Sub-domains (like <code>blog1.example.com</code>)</label><br /> 146 <label><input type='radio' name='vhost' value='0' <?php if( !$rewrite_enabled ) echo 'checked="checked"'; ?> /> Sub-directories (like <code>example.com/blog1</code>)</label> 147 147 </p> 148 148 149 149 <h2>Server Address</h2> … … 197 197 function step2_config() { 198 198 global $base, $wpdb, $vhost; 199 199 200 $vhost = stripslashes($_POST['vhost' ]);200 $vhost = (bool) stripslashes($_POST['vhost' ]); 201 201 $prefix = $wpdb->base_prefix; 202 202 203 203 $config_sample = ABSPATH . 'wp-admin/includes/wp-config.ms'; … … 224 224 $output = str_replace("localhost", DB_HOST, $line); 225 225 break; 226 226 case "define('VHOST',": 227 $output = str_replace(" VHOSTSETTING", $vhost, $line);227 $output = str_replace("'VHOSTSETTING'", $vhost ? 'true' : 'false', $line); 228 228 break; 229 229 case '$table_prefix =': 230 230 $output = str_replace('wp_', $prefix, $line); … … 285 285 // create network tables 286 286 $domain = get_clean_basedomain(); 287 287 install_network(); 288 populate_network( 1, $domain, sanitize_email( $_POST[ 'email' ] ), $_POST[ 'weblog_title' ], $base, $_POST[ 'vhost' ] );288 populate_network( 1, $domain, sanitize_email( $_POST[ 'email' ] ), $_POST[ 'weblog_title' ], $base, (bool) $_POST[ 'vhost' ] ); 289 289 // create wp-config.php / htaccess 290 290 step2(); 291 291 break;