http://www.mediawiki.org/wiki/Special:Code/MediaWiki/88973

Revision: 88973
Author:   vyznev
Date:     2011-05-27 16:14:09 +0000 (Fri, 27 May 2011)
Log Message:
-----------
fix broken condition in r83847 (tested)

Modified Paths:
--------------
    trunk/phase3/includes/DefaultSettings.php

Modified: trunk/phase3/includes/DefaultSettings.php
===================================================================
--- trunk/phase3/includes/DefaultSettings.php   2011-05-27 15:57:07 UTC (rev 
88972)
+++ trunk/phase3/includes/DefaultSettings.php   2011-05-27 16:14:09 UTC (rev 
88973)
@@ -55,10 +55,10 @@
 
 /** @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'] ) ) {


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to