X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/00dbffaf1593b0ac719d98f00839221a9ca52133..1132430022383fdf47fa6cb9377300fd885297aa:/wp-admin/network.php?ds=sidebyside diff --git a/wp-admin/network.php b/wp-admin/network.php index d5549145..051295a1 100644 --- a/wp-admin/network.php +++ b/wp-admin/network.php @@ -13,7 +13,7 @@ define( 'WP_INSTALLING_NETWORK', true ); /** WordPress Administration Bootstrap */ -require_once( './admin.php' ); +require_once( dirname( __FILE__ ) . '/admin.php' ); if ( ! is_super_admin() ) wp_die( __( 'You do not have sufficient permissions to manage options for this site.' ) ); @@ -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; } @@ -58,13 +61,20 @@ function allow_subdomain_install() { return true; } /** - * Allow subdirectory install + * Allow subdirectory install. * * @since 3.0.0 * @return bool Whether subdirectory install is allowed */ function allow_subdirectory_install() { global $wpdb; + /** + * Filter whether to enable the subdirectory install feature in Multisite. + * + * @since 3.0.0 + * + * @param bool true Whether to enable the subdirectory install feature in Multisite. Default is false. + */ if ( apply_filters( 'allow_subdirectory_install', false ) ) return true; @@ -123,13 +133,12 @@ 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' ); ?>
-

' . __('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(); } @@ -213,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 ); ?>
@@ -285,14 +294,18 @@ function network_step1( $errors = false ) { -
+

+ +

- + -
+

+ +

@@ -314,14 +327,16 @@ function network_step2( $errors = false ) { $base = parse_url( $slashed_home, PHP_URL_PATH ); $document_root_fix = str_replace( '\\', '/', realpath( $_SERVER['DOCUMENT_ROOT'] ) ); $abspath_fix = str_replace( '\\', '/', ABSPATH ); - $home_path = 0 === strpos( $abspath_fix, $document_root_fix ) ? $document_root_fix . $base : str_replace( '\\', '/', get_home_path() ); + $home_path = 0 === strpos( $abspath_fix, $document_root_fix ) ? $document_root_fix . $base : get_home_path(); $wp_siteurl_subdir = preg_replace( '#^' . preg_quote( $home_path, '#' ) . '#', '', $abspath_fix ); $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 ) ) @@ -368,7 +383,7 @@ function network_step2( $errors = false ) { ?>
  1. wp-config.php file in %s above the line reading /* That’s all, stop editing! Happy blogging. */:' ), $location_of_wp_config ); ?>

    -