Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -55,10 +55,10 @@ |
56 | 56 | |
57 | 57 | /** @cond file_level_code */ |
58 | 58 | if( isset( $_SERVER['SERVER_NAME'] ) |
59 | | - # additionially, for requests made directly to an IPv6 address we have |
60 | | - # to make sure the server enclose it in either [] or nothing at all |
61 | | - && (strpos($_SERVER['SERVER_NAME'], '[') |
62 | | - xor strpos( $_SERVER['SERVER_NAME'], ']')) |
| 59 | + # KLUGE: lighttpd 1.4.28 truncates IPv6 addresses at the first colon, |
| 60 | + # giving bogus hostnames like "[2001"; check for presence of both |
| 61 | + # brackets to detect this. |
| 62 | + && ($_SERVER['SERVER_NAME'][0] !== '[' || substr($_SERVER['SERVER_NAME'], -1) === ']') |
63 | 63 | ) { |
64 | 64 | $serverName = $_SERVER['SERVER_NAME']; |
65 | 65 | } elseif( isset( $_SERVER['HOSTNAME'] ) ) { |