WordPress.org

Make WordPress Core

Ticket #15936: fix_ipv6_literals.patch

File fix_ipv6_literals.patch, 1.0 KB (added by jmdh, 7 years ago)

Fix IPv6 literals in URLs for Wordpress 3.0.3

  • wp-includes/ms-settings.php

    diff -urN wordpress-3.0.3.orig//wp-includes/ms-settings.php wordpress-3.0.3/wp-includes/ms-settings.php
    old new  
    2626
    2727if ( !isset( $current_site ) || !isset( $current_blog ) ) {
    2828
     29        $_SERVER['HTTP_HOST'] = preg_replace( '|:\d+$|', '', $_SERVER['HTTP_HOST'] );
    2930        $domain = addslashes( $_SERVER['HTTP_HOST'] );
    30         if ( false !== strpos( $domain, ':' ) ) {
    31                 if ( substr( $domain, -3 ) == ':80' ) {
    32                         $domain = substr( $domain, 0, -3 );
    33                         $_SERVER['HTTP_HOST'] = substr( $_SERVER['HTTP_HOST'], 0, -3 );
    34                 } elseif ( substr( $domain, -4 ) == ':443' ) {
    35                         $domain = substr( $domain, 0, -4 );
    36                         $_SERVER['HTTP_HOST'] = substr( $_SERVER['HTTP_HOST'], 0, -4 );
    37                 } else {
    38                         wp_die( /*WP_I18N_NO_PORT_NUMBER*/'Multisite only works without the port number in the URL.'/*/WP_I18N_NO_PORT_NUMBER*/ );
    39                 }
    40         }
    4131
    4232        $domain = rtrim( $domain, '.' );
    4333        $cookie_domain = $domain;