Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -54,7 +54,12 @@ |
55 | 55 | $wgServer = ''; |
56 | 56 | |
57 | 57 | /** @cond file_level_code */ |
58 | | -if( isset( $_SERVER['SERVER_NAME'] ) ) { |
| 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'], ']')) |
| 63 | + ) { |
59 | 64 | $serverName = $_SERVER['SERVER_NAME']; |
60 | 65 | } elseif( isset( $_SERVER['HOSTNAME'] ) ) { |
61 | 66 | $serverName = $_SERVER['HOSTNAME']; |