Changeset 13926
- Timestamp:
- 04/02/2010 02:04:25 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/network.php
r13904 r13926 37 37 } 38 38 39 /** 40 * Allow subdomain install 41 * 42 * @since 3.0.0 43 * @return bool - whether subdomain install is allowed 44 */ 45 function allow_subdomain_install() { 46 $path = preg_replace( '|https?://[^/]|', '', get_option( 'siteurl' ) ); 47 if( strlen( $path ) > 1 || 'localhost' == $_SERVER[ 'HTTP_HOST' ] ) 48 return false; 49 50 return true; 51 } 39 52 /** 40 53 * Get base domain of network. … … 135 148 } 136 149 137 if ( 'localhost' != $hostname) : ?>150 if ( allow_subdomain_install() ) : ?> 138 151 <h3><?php esc_html_e( 'Addresses of Sites in your Network' ); ?></h3> 139 152 <p><?php _e( 'Please choose whether you would like sites in your WordPress network to use sub-domains or sub-directories. <strong>You cannot change this later.</strong>' ); ?></p> … … 176 189 <td><?php _e('Because you are using <code>localhost</code>, the sites in your WordPress network must use sub-directories. Consider using <code>localhost.localdomain</code> if you wish to use sub-domains.'); ?></td> 177 190 </tr> 191 <?php elseif ( !allow_subdomain_install() ) : ?> 192 <tr> 193 <th scope="row"><?php esc_html_e( 'Sub-directory Install' ); ?></th> 194 <td><?php _e('Because your install is in a directory, the sites in your WordPress network must use sub-directories.'); ?></td> 195 </tr> 178 196 <?php endif; ?> 179 197 <?php if ( ! $is_www ) : ?> … … 218 236 219 237 if ( $_POST ) { 220 $vhost = 'localhost' == $hostname? false : (bool) $_POST['subdomain_install'];238 $vhost = !allow_subdomain_install() ? false : (bool) $_POST['subdomain_install']; 221 239 } else { 222 240 if ( is_multisite() ) { … … 327 345 install_network(); 328 346 $hostname = get_clean_basedomain(); 329 $subdomain_install = 'localhost' == $hostname? false : (bool) $_POST['subdomain_install'];347 $subdomain_install = !allow_subdomain_install() ? false : (bool) $_POST['subdomain_install']; 330 348 if ( ! network_domain_check() ) { 331 349 $result = populate_network( 1, get_clean_basedomain(), sanitize_email( $_POST['email'] ), $_POST['sitename'], $base, $subdomain_install );
Note: See TracChangeset
for help on using the changeset viewer.