From 06bb14ff47fce07adabe142311209076410da7d2 Mon Sep 17 00:00:00 2001 From: Herman van Rink Date: Sun, 31 May 2009 12:50:52 +0000 Subject: [PATCH] bug #2799009 Login with ipv6 IP address breaks redirect --- ChangeLog | 1 + libraries/Config.class.php | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index e48339ca4..39e028e19 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,7 @@ $Id$ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyAdmin/ChangeLog $ 3.2.1.0 (not yet released) +- bug #2799009 Login with ipv6 IP address breaks redirect 3.2.0.0 (not yet released) - [core] better support for vendor customisation (based on what Debian needs) diff --git a/libraries/Config.class.php b/libraries/Config.class.php index 98d0483b8..8f43c1708 100644 --- a/libraries/Config.class.php +++ b/libraries/Config.class.php @@ -603,9 +603,10 @@ class PMA_Config // Host and port if (PMA_getenv('HTTP_HOST')) { - if (strpos(PMA_getenv('HTTP_HOST'), ':') !== false) { - list($url['host'], $url['port']) = - explode(':', PMA_getenv('HTTP_HOST')); + // Prepend the scheme before using parse_url() since this is not part of the RFC2616 Host request-header + $parsed_url = parse_url($url['scheme'] . '://' . PMA_getenv('HTTP_HOST')); + if (!empty($parsed_url['host'])) { + $url = $parsed_url; } else { $url['host'] = PMA_getenv('HTTP_HOST'); }