From 997a121259de0a87d75ac8345cab21195ee1c094 Mon Sep 17 00:00:00 2001 From: Ron Rennick Date: Mon, 3 May 2010 19:23:37 +0000 Subject: [PATCH] allow subdir multisite on ip address, see #12142 git-svn-id: https://develop.svn.wordpress.org/trunk@14386 602fd350-edb4-49c9-b593-d223f7449a82 --- 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 745fc1f073..4caf4cdeac 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.' ) . '

';