From 7832748847a7fe0382067d78a2f3adfed53a8d64 Mon Sep 17 00:00:00 2001 From: wpmuguru Date: Mon, 3 May 2010 19:23:37 +0000 Subject: [PATCH] allow subdir multisite on ip address, see #12142 git-svn-id: http://svn.automattic.com/wordpress/trunk@14386 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/network.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/wp-admin/network.php b/wp-admin/network.php index 745fc1f07..4caf4cdea 100644 --- a/wp-admin/network.php +++ b/wp-admin/network.php @@ -44,7 +44,7 @@ function network_domain_check() { */ function allow_subdomain_install() { $domain = preg_replace( '|https?://[^/]|', '', get_option( 'siteurl' ) ); - if( false !== strpos( $domain, '/' ) || 'localhost' == $_SERVER[ 'HTTP_HOST' ] ) + if( false !== strpos( $domain, '/' ) || 'localhost' == $domain || preg_match( '|[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+|', $domain ) ) return false; return true; @@ -106,8 +106,7 @@ function network_step1( $errors = false ) { $hostname = get_clean_basedomain(); $has_ports = strstr( $hostname, ':' ); - if ( ( false !== $has_ports && ! in_array( $has_ports, array( ':80', ':443' ) ) ) - || ( $no_ip = preg_match( '|[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+|', $hostname ) ) ) { + if ( ( false !== $has_ports && ! in_array( $has_ports, array( ':80', ':443' ) ) ) ) { echo '

' . __( 'Error:') . ' ' . __( 'You cannot install a network of sites with your server address.' ) . '

'; if ( $no_ip ) echo '

' . __( 'You cannot use an IP address such as 127.0.0.1.' ) . '

';