From 6de209f3b6e30d32e5e862139d4dcb6376ba7d4c Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Wed, 30 Jul 2008 03:23:38 +0000 Subject: [PATCH] (bug 14977) Installations on servers using IPv6 addresses for $wgServer were largely unusable because $wgServer didn't wrap the IP in brackets --- RELEASE-NOTES | 2 ++ includes/DefaultSettings.php | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 98af2980e3..e1280f440c 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -43,6 +43,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 14954) Fix regression in Modern and Simple skins * Recursion loop check added to Categoryfinder class * Fixed few performance troubles of large job queue processing +* (bug 14977) Installations on servers using IPv6 addresses for $wgServer + were largely unusable because $wgServer didn't wrap the IP in brackets. === API changes in 1.14 === diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 2cc0672eae..e50f662b70 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -69,6 +69,12 @@ if( isset( $_SERVER['SERVER_NAME'] ) ) { $wgServerName = 'localhost'; } +# Before we put http:// and other things onto it, need to +# wrap IPv6 in []. Bug 14977. +if ( IP::isIPv6( $wgServerName ) ) { + $wgServerName = '[' . $wgServerName . ']'; +} + # check if server use https: $wgProto = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http'; -- 2.20.1