X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/e08b42e8ad054ec67522d7ac1aaae5dc68cb3d01..2329f698283944696a7076258cf816545970bb47:/wp-admin/network.php diff --git a/wp-admin/network.php b/wp-admin/network.php index fe7effe0..e5046f9b 100644 --- a/wp-admin/network.php +++ b/wp-admin/network.php @@ -39,8 +39,11 @@ foreach ( $wpdb->tables( 'ms_global' ) as $table => $prefixed_table ) */ function network_domain_check() { global $wpdb; - if ( $wpdb->get_var( "SHOW TABLES LIKE '$wpdb->site'" ) ) + + $sql = $wpdb->prepare( "SHOW TABLES LIKE %s", $wpdb->esc_like( $wpdb->site ) ); + if ( $wpdb->get_var( $sql ) ) { return $wpdb->get_var( "SELECT domain FROM $wpdb->site ORDER BY id ASC LIMIT 1" ); + } return false; } @@ -130,7 +133,7 @@ get_current_screen()->set_help_sidebar( '

' . __('For more information:') . '

' . '

' . __('Documentation on Creating a Network') . '

' . '

' . __('Documentation on the Network Screen') . '

' . - '

' . __('Support Forums') . '

' + '

' . __('Support Forums') . '

' ); include( ABSPATH . 'wp-admin/admin-header.php' ); @@ -153,7 +156,7 @@ function network_step1( $errors = false ) { if ( defined('DO_NOT_UPGRADE_GLOBAL_TABLES') ) { echo '

' . __('ERROR:') . ' ' . __( 'The constant DO_NOT_UPGRADE_GLOBAL_TABLES cannot be defined when creating a network.' ) . '

'; echo ''; - include ( ABSPATH . 'wp-admin/admin-footer.php' ); + include( ABSPATH . 'wp-admin/admin-footer.php' ); die(); } @@ -219,11 +222,11 @@ function network_step1( $errors = false ) { - + - +
site1.%1$s and site2.%1$s', 'subdomain examples' ), $hostname ); ?>
%1$s/site1 and %1$s/site2', 'subdirectory examples' ), $hostname ); ?>
@@ -329,9 +332,11 @@ function network_step2( $errors = false ) { $rewrite_base = ! empty( $wp_siteurl_subdir ) ? ltrim( trailingslashit( $wp_siteurl_subdir ), '/' ) : ''; - $location_of_wp_config = ABSPATH; - if ( ! file_exists( ABSPATH . 'wp-config.php' ) && file_exists( dirname( ABSPATH ) . '/wp-config.php' ) ) - $location_of_wp_config = trailingslashit( dirname( ABSPATH ) ); + $location_of_wp_config = $abspath_fix; + if ( ! file_exists( ABSPATH . 'wp-config.php' ) && file_exists( dirname( ABSPATH ) . '/wp-config.php' ) ) { + $location_of_wp_config = dirname( $abspath_fix ); + } + $location_of_wp_config = trailingslashit( $location_of_wp_config ); // Wildcard DNS message. if ( is_wp_error( $errors ) ) @@ -434,7 +439,7 @@ define('BLOG_ID_CURRENT_SITE', 1); $web_config_file .= ' - + '; } $web_config_file .= ' @@ -467,9 +472,11 @@ define('BLOG_ID_CURRENT_SITE', 1); '; - ?> -
  • web.config file in %s, replacing other WordPress rules:' ), $home_path ); ?>

    -

    '; + /* translators: 1: a filename like .htaccess. 2: a file path. */ + printf( __( 'Add the following to your %1$s file in %2$s, replacing other WordPress rules:' ), + 'web.config', '' . $home_path . '' ); + echo '

    '; if ( ! $subdomain_install && WP_CONTENT_DIR != ABSPATH . 'wp-content' ) echo '

    ' . __('Warning:') . ' ' . __( 'Subdirectory networks may not be fully compatible with custom wp-content directories.' ) . '

    '; ?> @@ -482,7 +489,7 @@ define('BLOG_ID_CURRENT_SITE', 1); $ms_files_rewriting = ''; if ( is_multisite() && get_site_option( 'ms_files_rewriting' ) ) { $ms_files_rewriting = "\n# uploaded files\nRewriteRule ^"; - $ms_files_rewriting .= $subdir_match . "files/(.+) {$rewrite_base}wp-includes/ms-files.php?file={$subdir_replacement_12} [L]" . "\n"; + $ms_files_rewriting .= $subdir_match . "files/(.+) {$rewrite_base}" . WPINC . "/ms-files.php?file={$subdir_replacement_12} [L]" . "\n"; } $htaccess_file = << -
  • .htaccess file in %s, replacing other WordPress rules:' ), $home_path ); ?>

    -

    '; + /* translators: 1: a filename like .htaccess. 2: a file path. */ + printf( __( 'Add the following to your %1$s file in %2$s, replacing other WordPress rules:' ), + '.htaccess', '' . $home_path . '' ); + echo '

    '; if ( ! $subdomain_install && WP_CONTENT_DIR != ABSPATH . 'wp-content' ) echo '

    ' . __('Warning:') . ' ' . __( 'Subdirectory networks may not be fully compatible with custom wp-content directories.' ) . '

    '; ?> @@ -524,7 +533,7 @@ if ( $_POST ) { check_admin_referer( 'install-network-1' ); require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); - // create network tables + // Create network tables. install_network(); $base = parse_url( trailingslashit( get_option( 'home' ) ), PHP_URL_PATH ); $subdomain_install = allow_subdomain_install() ? !empty( $_POST['subdomain_install'] ) : false;