From: Ilmari Karonen Date: Fri, 27 May 2011 16:14:09 +0000 (+0000) Subject: fix broken condition in r83847 (tested) X-Git-Tag: 1.31.0-rc.0~29913 X-Git-Url: http://git.cyclocoop.org/ecrire?a=commitdiff_plain;h=177ef9de7b05798dc1ef4f39a4bba4698ab3c861;p=lhc%2Fweb%2Fwiklou.git fix broken condition in r83847 (tested) --- diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 012ac5f6f6..cddaab7f75 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -55,10 +55,10 @@ $wgServer = ''; /** @cond file_level_code */ if( isset( $_SERVER['SERVER_NAME'] ) - # additionially, for requests made directly to an IPv6 address we have - # to make sure the server enclose it in either [] or nothing at all - && (strpos($_SERVER['SERVER_NAME'], '[') - xor strpos( $_SERVER['SERVER_NAME'], ']')) + # KLUGE: lighttpd 1.4.28 truncates IPv6 addresses at the first colon, + # giving bogus hostnames like "[2001"; check for presence of both + # brackets to detect this. + && ($_SERVER['SERVER_NAME'][0] !== '[' || substr($_SERVER['SERVER_NAME'], -1) === ']') ) { $serverName = $_SERVER['SERVER_NAME']; } elseif( isset( $_SERVER['HOSTNAME'] ) ) {