From 177ef9de7b05798dc1ef4f39a4bba4698ab3c861 Mon Sep 17 00:00:00 2001 From: Ilmari Karonen Date: Fri, 27 May 2011 16:14:09 +0000 Subject: [PATCH] fix broken condition in r83847 (tested) --- includes/DefaultSettings.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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'] ) ) { -- 2.20.1