Index: t3lib/class.t3lib_div.php =================================================================== --- t3lib/class.t3lib_div.php (revision 8192) +++ t3lib/class.t3lib_div.php (working copy) @@ -4040,12 +4040,19 @@ $retVal = $DR; break; case 'TYPO3_HOST_ONLY': - $p = explode(':',self::getIndpEnv('HTTP_HOST')); - $retVal = $p[0]; + $httpHost = t3lib_div::getIndpEnv('HTTP_HOST'); + $httpHostPos = strpos($httpHost, ']'); + // return $httpHost up to the position of $httpHostPos + (int) 1 (IPv6) + // or return string before ':' (IPv4) + $retVal = ($httpHostPos !== FALSE) ? substr($httpHost, 0, ($httpHostPos + 1)) : array_shift(explode(':', $httpHost)); break; case 'TYPO3_PORT': - $p = explode(':',self::getIndpEnv('HTTP_HOST')); - $retVal = $p[1]; + $httpHost = t3lib_div::getIndpEnv('HTTP_HOST'); + $httpHostPos = strpos($httpHost, ']'); + // return $httpHost from the position of $httpHostPos + (int) 2 (IPv6) + // or return string after ':' (IPv4) + $retVal = ($httpHostPos !== FALSE) ? substr($httpHost, ($httpHostPos + 2)) : + ((strpos($httpHost, ':') !== FALSE) ? array_pop(explode(':', $httpHost)) : ''); break; case 'TYPO3_REQUEST_HOST': $retVal = (self::getIndpEnv('TYPO3_SSL') ? 'https://' : 'http://').