Changeset 42343 for trunk/src/wp-admin/includes/network.php
- Timestamp:
- 11/30/2017 11:09:33 PM (8 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-admin/includes/network.php (modified) (29 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/network.php
r41924 r42343 20 20 global $wpdb; 21 21 22 $sql = $wpdb->prepare( "SHOW TABLES LIKE %s", $wpdb->esc_like( $wpdb->site ) );22 $sql = $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->esc_like( $wpdb->site ) ); 23 23 if ( $wpdb->get_var( $sql ) ) { 24 24 return $wpdb->get_var( "SELECT domain FROM $wpdb->site ORDER BY id ASC LIMIT 1" ); … … 35 35 function allow_subdomain_install() { 36 36 $domain = preg_replace( '|https?://([^/]+)|', '$1', get_option( 'home' ) ); 37 if ( parse_url( get_option( 'home' ), PHP_URL_PATH ) || 'localhost' == $domain || preg_match( '|^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$|', $domain ) ) 37 if ( parse_url( get_option( 'home' ), PHP_URL_PATH ) || 'localhost' == $domain || preg_match( '|^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$|', $domain ) ) { 38 38 return false; 39 } 39 40 40 41 return true; … … 52 53 function allow_subdirectory_install() { 53 54 global $wpdb; 54 /**55 * Filters whether to enable the subdirectory installation feature in Multisite.56 *57 * @since 3.0.058 *59 * @param bool $allow Whether to enable the subdirectory installation feature in Multisite. Default is false.60 */61 if ( apply_filters( 'allow_subdirectory_install', false ) ) 55 /** 56 * Filters whether to enable the subdirectory installation feature in Multisite. 57 * 58 * @since 3.0.0 59 * 60 * @param bool $allow Whether to enable the subdirectory installation feature in Multisite. Default is false. 61 */ 62 if ( apply_filters( 'allow_subdirectory_install', false ) ) { 62 63 return true; 63 64 if ( defined( 'ALLOW_SUBDIRECTORY_INSTALL' ) && ALLOW_SUBDIRECTORY_INSTALL ) 64 } 65 66 if ( defined( 'ALLOW_SUBDIRECTORY_INSTALL' ) && ALLOW_SUBDIRECTORY_INSTALL ) { 65 67 return true; 68 } 66 69 67 70 $post = $wpdb->get_row( "SELECT ID FROM $wpdb->posts WHERE post_date < DATE_SUB(NOW(), INTERVAL 1 MONTH) AND post_status = 'publish'" ); 68 if ( empty( $post ) ) 71 if ( empty( $post ) ) { 69 72 return true; 73 } 70 74 71 75 return false; … … 79 83 */ 80 84 function get_clean_basedomain() { 81 if ( $existing_domain = network_domain_check() ) 85 if ( $existing_domain = network_domain_check() ) { 82 86 return $existing_domain; 87 } 83 88 $domain = preg_replace( '|https?://|', '', get_option( 'siteurl' ) ); 84 if ( $slash = strpos( $domain, '/' ) ) 89 if ( $slash = strpos( $domain, '/' ) ) { 85 90 $domain = substr( $domain, 0, $slash ); 91 } 86 92 return $domain; 87 93 } … … 91 97 * 92 98 * @todo Realistically, step 1 should be a welcome screen explaining what a Network is and such. Navigating to Tools > Network 93 * should not be a sudden "Welcome to a new install process! Fill this out and click here." See also contextual help todo.99 * should not be a sudden "Welcome to a new install process! Fill this out and click here." See also contextual help todo. 94 100 * 95 101 * @since 3.0.0 … … 102 108 global $is_apache; 103 109 104 if ( defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES') ) {110 if ( defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) ) { 105 111 echo '<div class="error"><p><strong>' . __( 'ERROR:' ) . '</strong> ' . sprintf( 106 112 /* translators: %s: DO_NOT_UPGRADE_GLOBAL_TABLES */ … … 126 132 } 127 133 128 $hostname = get_clean_basedomain();134 $hostname = get_clean_basedomain(); 129 135 $has_ports = strstr( $hostname, ':' ); 130 136 if ( ( false !== $has_ports && ! in_array( $has_ports, array( ':80', ':443' ) ) ) ) { … … 148 154 if ( is_wp_error( $errors ) ) { 149 155 echo '<div class="error"><p><strong>' . __( 'ERROR: The network could not be created.' ) . '</strong></p>'; 150 foreach ( $errors->get_error_messages() as $error ) 156 foreach ( $errors->get_error_messages() as $error ) { 151 157 echo "<p>$error</p>"; 158 } 152 159 echo '</div>'; 153 160 $error_codes = $errors->get_error_codes(); … … 173 180 if ( isset( $_POST['subdomain_install'] ) ) { 174 181 $subdomain_install = (bool) $_POST['subdomain_install']; 175 } elseif ( apache_mod_loaded( 'mod_rewrite') ) { // assume nothing182 } elseif ( apache_mod_loaded( 'mod_rewrite' ) ) { // assume nothing 176 183 $subdomain_install = true; 177 } elseif ( ! allow_subdirectory_install() ) {184 } elseif ( ! allow_subdirectory_install() ) { 178 185 $subdomain_install = true; 179 186 } else { … … 182 189 echo '<div class="updated inline"><p><strong>' . __( 'Note:' ) . '</strong> '; 183 190 /* translators: %s: mod_rewrite */ 184 printf( __( 'Please make sure the Apache %s module is installed as it will be used at the end of this installation.' ), 191 printf( 192 __( 'Please make sure the Apache %s module is installed as it will be used at the end of this installation.' ), 185 193 '<code>mod_rewrite</code>' 186 194 ); … … 189 197 echo '<div class="error inline"><p><strong>' . __( 'Warning:' ) . '</strong> '; 190 198 /* translators: %s: mod_rewrite */ 191 printf( __( 'It looks like the Apache %s module is not installed.' ), 199 printf( 200 __( 'It looks like the Apache %s module is not installed.' ), 192 201 '<code>mod_rewrite</code>' 193 202 ); … … 198 207 echo '<p>'; 199 208 /* translators: 1: mod_rewrite, 2: mod_rewrite documentation URL, 3: Google search for mod_rewrite */ 200 printf( __( 'If %1$s is disabled, ask your administrator to enable that module, or look at the <a href="%2$s">Apache documentation</a> or <a href="%3$s">elsewhere</a> for help setting it up.' ), 209 printf( 210 __( 'If %1$s is disabled, ask your administrator to enable that module, or look at the <a href="%2$s">Apache documentation</a> or <a href="%3$s">elsewhere</a> for help setting it up.' ), 201 211 '<code>mod_rewrite</code>', 202 212 'https://httpd.apache.org/docs/mod/mod_rewrite.html', … … 207 217 } 208 218 209 if ( allow_subdomain_install() && allow_subdirectory_install() ) : ?> 219 if ( allow_subdomain_install() && allow_subdirectory_install() ) : 220 ?> 210 221 <h3><?php esc_html_e( 'Addresses of Sites in your Network' ); ?></h3> 211 222 <p><?php _e( 'Please choose whether you would like sites in your WordPress network to use sub-domains or sub-directories.' ); ?> … … 216 227 <tr> 217 228 <th><label><input type="radio" name="subdomain_install" value="1"<?php checked( $subdomain_install ); ?> /> <?php _e( 'Sub-domains' ); ?></label></th> 218 <td><?php printf( 229 <td> 230 <?php 231 printf( 219 232 /* translators: 1: hostname */ 220 233 _x( 'like <code>site1.%1$s</code> and <code>site2.%1$s</code>', 'subdomain examples' ), 221 234 $hostname 222 ); ?></td> 235 ); 236 ?> 237 </td> 223 238 </tr> 224 239 <tr> 225 240 <th><label><input type="radio" name="subdomain_install" value="0"<?php checked( ! $subdomain_install ); ?> /> <?php _e( 'Sub-directories' ); ?></label></th> 226 <td><?php printf( 241 <td> 242 <?php 243 printf( 227 244 /* translators: 1: hostname */ 228 245 _x( 'like <code>%1$s/site1</code> and <code>%1$s/site2</code>', 'subdirectory examples' ), 229 246 $hostname 230 ); ?></td> 247 ); 248 ?> 249 </td> 231 250 </tr> 232 251 </table> … … 235 254 endif; 236 255 237 if ( WP_CONTENT_DIR != ABSPATH . 'wp-content' && ( allow_subdirectory_install() || ! allow_subdomain_install() ) ) 238 echo '<div class="error inline"><p><strong>' . __( 'Warning:' ) . '</strong> ' . __( 'Subdirectory networks may not be fully compatible with custom wp-content directories.' ) . '</p></div>'; 256 if ( WP_CONTENT_DIR != ABSPATH . 'wp-content' && ( allow_subdirectory_install() || ! allow_subdomain_install() ) ) { 257 echo '<div class="error inline"><p><strong>' . __( 'Warning:' ) . '</strong> ' . __( 'Subdirectory networks may not be fully compatible with custom wp-content directories.' ) . '</p></div>'; 258 } 239 259 240 260 $is_www = ( 0 === strpos( $hostname, 'www.' ) ); 241 if ( $is_www ) :261 if ( $is_www ) : 242 262 ?> 243 263 <h3><?php esc_html_e( 'Server Address' ); ?></h3> 244 <p><?php printf( 264 <p> 265 <?php 266 printf( 245 267 /* translators: 1: site url 2: host name 3. www */ 246 268 __( 'We recommend you change your siteurl to %1$s before enabling the network feature. It will still be possible to visit your site using the %3$s prefix with an address like %2$s but any links will not have the %3$s prefix.' ), … … 248 270 '<code>' . $hostname . '</code>', 249 271 '<code>www</code>' 250 ); ?></p> 272 ); 273 ?> 274 </p> 251 275 <table class="form-table"> 252 276 <tr> 253 <th scope='row'><?php esc_html_e( 'Server Address' ); ?></th> 254 <td> 255 <?php printf( 277 <th scope='row'><?php esc_html_e( 'Server Address' ); ?></th> 278 <td> 279 <?php 280 printf( 256 281 /* translators: %s: host name */ 257 282 __( 'The internet address of your network will be %s.' ), 258 283 '<code>' . $hostname . '</code>' 259 ); ?> 284 ); 285 ?> 260 286 </td> 261 287 </tr> … … 268 294 <tr> 269 295 <th scope="row"><?php esc_html_e( 'Sub-directory Installation' ); ?></th> 270 <td><?php 296 <td> 297 <?php 271 298 printf( 272 299 /* translators: 1: localhost 2: localhost.localdomain */ … … 276 303 ); 277 304 // Uh oh: 278 if ( !allow_subdirectory_install() ) 279 echo ' <strong>' . __( 'Warning:' ) . ' ' . __( 'The main site in a sub-directory installation will need to use a modified permalink structure, potentially breaking existing links.' ) . '</strong>'; 280 ?></td> 281 </tr> 282 <?php elseif ( !allow_subdomain_install() ) : ?> 305 if ( ! allow_subdirectory_install() ) { 306 echo ' <strong>' . __( 'Warning:' ) . ' ' . __( 'The main site in a sub-directory installation will need to use a modified permalink structure, potentially breaking existing links.' ) . '</strong>'; 307 } 308 ?> 309 </td> 310 </tr> 311 <?php elseif ( ! allow_subdomain_install() ) : ?> 283 312 <tr> 284 313 <th scope="row"><?php esc_html_e( 'Sub-directory Installation' ); ?></th> 285 <td><?php 314 <td> 315 <?php 286 316 _e( 'Because your installation is in a directory, the sites in your WordPress network must use sub-directories.' ); 287 317 // Uh oh: 288 if ( !allow_subdirectory_install() ) 289 echo ' <strong>' . __( 'Warning:' ) . ' ' . __( 'The main site in a sub-directory installation will need to use a modified permalink structure, potentially breaking existing links.' ) . '</strong>'; 290 ?></td> 291 </tr> 292 <?php elseif ( !allow_subdirectory_install() ) : ?> 318 if ( ! allow_subdirectory_install() ) { 319 echo ' <strong>' . __( 'Warning:' ) . ' ' . __( 'The main site in a sub-directory installation will need to use a modified permalink structure, potentially breaking existing links.' ) . '</strong>'; 320 } 321 ?> 322 </td> 323 </tr> 324 <?php elseif ( ! allow_subdirectory_install() ) : ?> 293 325 <tr> 294 326 <th scope="row"><?php esc_html_e( 'Sub-domain Installation' ); ?></th> 295 <td><?php _e( 'Because your installation is not new, the sites in your WordPress network must use sub-domains.' ); 327 <td> 328 <?php 329 _e( 'Because your installation is not new, the sites in your WordPress network must use sub-domains.' ); 296 330 echo ' <strong>' . __( 'The main site in a sub-directory installation will need to use a modified permalink structure, potentially breaking existing links.' ) . '</strong>'; 297 ?></td> 331 ?> 332 </td> 298 333 </tr> 299 334 <?php endif; ?> … … 302 337 <th scope='row'><?php esc_html_e( 'Server Address' ); ?></th> 303 338 <td> 304 <?php printf( 339 <?php 340 printf( 305 341 /* translators: %s: host name */ 306 342 __( 'The internet address of your network will be %s.' ), 307 343 '<code>' . $hostname . '</code>' 308 ); ?> 344 ); 345 ?> 309 346 </td> 310 347 </tr> … … 355 392 $rewrite_base = ! empty( $wp_siteurl_subdir ) ? ltrim( trailingslashit( $wp_siteurl_subdir ), '/' ) : ''; 356 393 357 358 394 $location_of_wp_config = $abspath_fix; 359 395 if ( ! file_exists( ABSPATH . 'wp-config.php' ) && file_exists( dirname( ABSPATH ) . '/wp-config.php' ) ) { … … 363 399 364 400 // Wildcard DNS message. 365 if ( is_wp_error( $errors ) ) 401 if ( is_wp_error( $errors ) ) { 366 402 echo '<div class="error">' . $errors->get_error_message() . '</div>'; 403 } 367 404 368 405 if ( $_POST ) { 369 if ( allow_subdomain_install() ) 406 if ( allow_subdomain_install() ) { 370 407 $subdomain_install = allow_subdirectory_install() ? ! empty( $_POST['subdomain_install'] ) : true; 371 else408 } else { 372 409 $subdomain_install = false; 410 } 373 411 } else { 374 412 if ( is_multisite() ) { … … 394 432 <h3><?php esc_html_e( 'Enabling the Network' ); ?></h3> 395 433 <p><?php _e( 'Complete the following steps to enable the features for creating a network of sites.' ); ?></p> 396 <div class="updated inline"><p><?php 397 if ( file_exists( $home_path . '.htaccess' ) ) { 398 echo '<strong>' . __( 'Caution:' ) . '</strong> '; 399 printf( 400 /* translators: 1: wp-config.php 2: .htaccess */ 401 __( 'We recommend you back up your existing %1$s and %2$s files.' ), 402 '<code>wp-config.php</code>', 403 '<code>.htaccess</code>' 404 ); 405 } elseif ( file_exists( $home_path . 'web.config' ) ) { 406 echo '<strong>' . __( 'Caution:' ) . '</strong> '; 407 printf( 408 /* translators: 1: wp-config.php 2: web.config */ 409 __( 'We recommend you back up your existing %1$s and %2$s files.' ), 410 '<code>wp-config.php</code>', 411 '<code>web.config</code>' 412 ); 413 } else { 414 echo '<strong>' . __( 'Caution:' ) . '</strong> '; 415 printf( 416 /* translators: 1: wp-config.php */ 417 __( 'We recommend you back up your existing %s file.' ), 418 '<code>wp-config.php</code>' 419 ); 420 } 421 ?></p></div> 434 <div class="updated inline"><p> 435 <?php 436 if ( file_exists( $home_path . '.htaccess' ) ) { 437 echo '<strong>' . __( 'Caution:' ) . '</strong> '; 438 printf( 439 /* translators: 1: wp-config.php 2: .htaccess */ 440 __( 'We recommend you back up your existing %1$s and %2$s files.' ), 441 '<code>wp-config.php</code>', 442 '<code>.htaccess</code>' 443 ); 444 } elseif ( file_exists( $home_path . 'web.config' ) ) { 445 echo '<strong>' . __( 'Caution:' ) . '</strong> '; 446 printf( 447 /* translators: 1: wp-config.php 2: web.config */ 448 __( 'We recommend you back up your existing %1$s and %2$s files.' ), 449 '<code>wp-config.php</code>', 450 '<code>web.config</code>' 451 ); 452 } else { 453 echo '<strong>' . __( 'Caution:' ) . '</strong> '; 454 printf( 455 /* translators: 1: wp-config.php */ 456 __( 'We recommend you back up your existing %s file.' ), 457 '<code>wp-config.php</code>' 458 ); 459 } 460 ?> 461 </p></div> 422 462 <?php 423 463 } 424 464 ?> 425 465 <ol> 426 <li><p><?php printf( 466 <li><p> 467 <?php 468 printf( 427 469 /* translators: 1: wp-config.php 2: location of wp-config file, 3: translated version of "That's all, stop editing! Happy blogging." */ 428 470 __( 'Add the following to your %1$s file in %2$s <strong>above</strong> the line reading %3$s:' ), … … 435 477 */ 436 478 '<code>/* ' . __( 'That’s all, stop editing! Happy blogging.' ) . ' */</code>' 437 ); ?></p> 479 ); 480 ?> 481 </p> 438 482 <textarea class="code" readonly="readonly" cols="100" rows="7"> 439 483 define('MULTISITE', true); … … 445 489 </textarea> 446 490 <?php 447 $keys_salts = array( 'AUTH_KEY' => '', 'SECURE_AUTH_KEY' => '', 'LOGGED_IN_KEY' => '', 'NONCE_KEY' => '', 'AUTH_SALT' => '', 'SECURE_AUTH_SALT' => '', 'LOGGED_IN_SALT' => '', 'NONCE_SALT' => '' ); 448 foreach ( $keys_salts as $c => $v ) { 449 if ( defined( $c ) ) 450 unset( $keys_salts[ $c ] ); 451 } 452 453 if ( ! empty( $keys_salts ) ) { 454 $keys_salts_str = ''; 455 $from_api = wp_remote_get( 'https://api.wordpress.org/secret-key/1.1/salt/' ); 456 if ( is_wp_error( $from_api ) ) { 457 foreach ( $keys_salts as $c => $v ) { 458 $keys_salts_str .= "\ndefine( '$c', '" . wp_generate_password( 64, true, true ) . "' );"; 459 } 460 } else { 461 $from_api = explode( "\n", wp_remote_retrieve_body( $from_api ) ); 462 foreach ( $keys_salts as $c => $v ) { 463 $keys_salts_str .= "\ndefine( '$c', '" . substr( array_shift( $from_api ), 28, 64 ) . "' );"; 464 } 465 } 466 $num_keys_salts = count( $keys_salts ); 491 $keys_salts = array( 492 'AUTH_KEY' => '', 493 'SECURE_AUTH_KEY' => '', 494 'LOGGED_IN_KEY' => '', 495 'NONCE_KEY' => '', 496 'AUTH_SALT' => '', 497 'SECURE_AUTH_SALT' => '', 498 'LOGGED_IN_SALT' => '', 499 'NONCE_SALT' => '', 500 ); 501 foreach ( $keys_salts as $c => $v ) { 502 if ( defined( $c ) ) { 503 unset( $keys_salts[ $c ] ); 504 } 505 } 506 507 if ( ! empty( $keys_salts ) ) { 508 $keys_salts_str = ''; 509 $from_api = wp_remote_get( 'https://api.wordpress.org/secret-key/1.1/salt/' ); 510 if ( is_wp_error( $from_api ) ) { 511 foreach ( $keys_salts as $c => $v ) { 512 $keys_salts_str .= "\ndefine( '$c', '" . wp_generate_password( 64, true, true ) . "' );"; 513 } 514 } else { 515 $from_api = explode( "\n", wp_remote_retrieve_body( $from_api ) ); 516 foreach ( $keys_salts as $c => $v ) { 517 $keys_salts_str .= "\ndefine( '$c', '" . substr( array_shift( $from_api ), 28, 64 ) . "' );"; 518 } 519 } 520 $num_keys_salts = count( $keys_salts ); 467 521 ?> 468 <p>469 <?php470 if ( 1 == $num_keys_salts ) {471 printf(472 /* translators: 1: wp-config.php */473 __( 'This unique authentication key is also missing from your %s file.' ),474 '<code>wp-config.php</code>'475 );476 } else {477 printf(478 /* translators: 1: wp-config.php */479 __( 'These unique authentication keys are also missing from your %s file.' ),480 '<code>wp-config.php</code>'481 );482 }522 <p> 523 <?php 524 if ( 1 == $num_keys_salts ) { 525 printf( 526 /* translators: 1: wp-config.php */ 527 __( 'This unique authentication key is also missing from your %s file.' ), 528 '<code>wp-config.php</code>' 529 ); 530 } else { 531 printf( 532 /* translators: 1: wp-config.php */ 533 __( 'These unique authentication keys are also missing from your %s file.' ), 534 '<code>wp-config.php</code>' 535 ); 536 } 483 537 ?> 484 538 <?php _e( 'To make your installation more secure, you should also add:' ); ?> … … 486 540 <textarea class="code" readonly="readonly" cols="100" rows="<?php echo $num_keys_salts; ?>"><?php echo esc_textarea( $keys_salts_str ); ?></textarea> 487 541 <?php 488 }542 } 489 543 ?> 490 544 </li> 491 545 <?php 492 if ( iis7_supports_permalinks() ) :493 // IIS doesn't support RewriteBase, all your RewriteBase are belong to us494 $iis_subdir_match= ltrim( $base, '/' ) . $subdir_match;495 $iis_rewrite_base= ltrim( $base, '/' ) . $rewrite_base;496 $iis_subdir_replacement = $subdomain_install ? '' : '{R:1}';497 498 $web_config_file = '<?xml version="1.0" encoding="UTF-8"?>546 if ( iis7_supports_permalinks() ) : 547 // IIS doesn't support RewriteBase, all your RewriteBase are belong to us 548 $iis_subdir_match = ltrim( $base, '/' ) . $subdir_match; 549 $iis_rewrite_base = ltrim( $base, '/' ) . $rewrite_base; 550 $iis_subdir_replacement = $subdomain_install ? '' : '{R:1}'; 551 552 $web_config_file = '<?xml version="1.0" encoding="UTF-8"?> 499 553 <configuration> 500 554 <system.webServer> … … 505 559 <action type="None" /> 506 560 </rule>'; 507 if ( is_multisite() && get_site_option( 'ms_files_rewriting' ) ) {508 $web_config_file .= '561 if ( is_multisite() && get_site_option( 'ms_files_rewriting' ) ) { 562 $web_config_file .= ' 509 563 <rule name="WordPress Rule for Files" stopProcessing="true"> 510 564 <match url="^' . $iis_subdir_match . 'files/(.+)" ignoreCase="false" /> 511 565 <action type="Rewrite" url="' . $iis_rewrite_base . WPINC . '/ms-files.php?file={R:1}" appendQueryString="false" /> 512 566 </rule>'; 513 }514 $web_config_file .= '567 } 568 $web_config_file .= ' 515 569 <rule name="WordPress Rule 2" stopProcessing="true"> 516 570 <match url="^' . $iis_subdir_match . 'wp-admin$" ignoreCase="false" /> … … 543 597 '; 544 598 545 echo '<li><p>'; 546 printf( 547 /* translators: 1: a filename like .htaccess. 2: a file path. */ 548 __( 'Add the following to your %1$s file in %2$s, <strong>replacing</strong> other WordPress rules:' ), 549 '<code>web.config</code>', 550 '<code>' . $home_path . '</code>' 551 ); 552 echo '</p>'; 553 if ( ! $subdomain_install && WP_CONTENT_DIR != ABSPATH . 'wp-content' ) 554 echo '<p><strong>' . __( 'Warning:' ) . ' ' . __( 'Subdirectory networks may not be fully compatible with custom wp-content directories.' ) . '</strong></p>'; 555 ?> 556 <textarea class="code" readonly="readonly" cols="100" rows="20"><?php echo esc_textarea( $web_config_file ); ?> 599 echo '<li><p>'; 600 printf( 601 /* translators: 1: a filename like .htaccess. 2: a file path. */ 602 __( 'Add the following to your %1$s file in %2$s, <strong>replacing</strong> other WordPress rules:' ), 603 '<code>web.config</code>', 604 '<code>' . $home_path . '</code>' 605 ); 606 echo '</p>'; 607 if ( ! $subdomain_install && WP_CONTENT_DIR != ABSPATH . 'wp-content' ) { 608 echo '<p><strong>' . __( 'Warning:' ) . ' ' . __( 'Subdirectory networks may not be fully compatible with custom wp-content directories.' ) . '</strong></p>'; 609 } 610 ?> 611 <textarea class="code" readonly="readonly" cols="100" rows="20"><?php echo esc_textarea( $web_config_file ); ?> 557 612 </textarea></li> 558 613 </ol> 559 614 560 <?php else : // end iis7_supports_permalinks(). construct an htaccess file instead: 615 <?php 616 else : // end iis7_supports_permalinks(). construct an htaccess file instead: 561 617 562 618 $ms_files_rewriting = ''; 563 619 if ( is_multisite() && get_site_option( 'ms_files_rewriting' ) ) { 564 $ms_files_rewriting = "\n# uploaded files\nRewriteRule ^";620 $ms_files_rewriting = "\n# uploaded files\nRewriteRule ^"; 565 621 $ms_files_rewriting .= $subdir_match . "files/(.+) {$rewrite_base}" . WPINC . "/ms-files.php?file={$subdir_replacement_12} [L]" . "\n"; 566 622 } … … 591 647 ); 592 648 echo '</p>'; 593 if ( ! $subdomain_install && WP_CONTENT_DIR != ABSPATH . 'wp-content' ) 649 if ( ! $subdomain_install && WP_CONTENT_DIR != ABSPATH . 'wp-content' ) { 594 650 echo '<p><strong>' . __( 'Warning:' ) . ' ' . __( 'Subdirectory networks may not be fully compatible with custom wp-content directories.' ) . '</strong></p>'; 651 } 595 652 ?> 596 653 <textarea class="code" readonly="readonly" cols="100" rows="<?php echo substr_count( $htaccess_file, "\n" ) + 1; ?>"> … … 598 655 </ol> 599 656 600 <?php endif; // end IIS/Apache code branches. 601 602 if ( !is_multisite() ) { ?> 657 <?php 658 endif; // end IIS/Apache code branches. 659 660 if ( ! is_multisite() ) { 661 ?> 603 662 <p><?php _e( 'Once you complete these steps, your network is enabled and configured. You will have to log in again.' ); ?> <a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e( 'Log In' ); ?></a></p> 604 <?php605 } 606 } 663 <?php 664 } 665 }
Note: See TracChangeset
for help on using the changeset viewer.