Ticket #15936: ms-settings_201301082151.patch
File ms-settings_201301082151.patch, 1.2 KB (added by , 12 years ago) |
---|
-
wp-includes/ms-settings.php
22 22 23 23 if ( !isset( $current_site ) || !isset( $current_blog ) ) { 24 24 25 // We don't know if $_SERVER['HTTP_HOST'] or $_SERVER['SERVER_NAME'] is set 26 $domain = $_SERVER['HTTP_HOST']; 27 if ( ! isset( $domain ) && ! empty( $_SERVER['SERVER_NAME'] ) ) { 28 $domain = $_SERVER['SERVER_NAME']; 29 } 30 $domain = preg_replace( '|:\d+$|', '', $domain ); 25 31 $domain = addslashes( $_SERVER['HTTP_HOST'] ); 26 if ( false !== strpos( $domain, ':' ) ) { 27 if ( substr( $domain, -3 ) == ':80' ) { 28 $domain = substr( $domain, 0, -3 ); 29 $_SERVER['HTTP_HOST'] = substr( $_SERVER['HTTP_HOST'], 0, -3 ); 30 } elseif ( substr( $domain, -4 ) == ':443' ) { 31 $domain = substr( $domain, 0, -4 ); 32 $_SERVER['HTTP_HOST'] = substr( $_SERVER['HTTP_HOST'], 0, -4 ); 33 } else { 34 wp_load_translations_early(); 35 wp_die( __( 'Multisite only works without the port number in the URL.' ) ); 36 } 37 } 32 $_SERVER['HTTP_HOST'] = $_SERVER['SERVER_NAME'] = $domain; 38 33 39 34 $domain = rtrim( $domain, '.' ); 40 35 $cookie_domain = $domain;