Project

General

Profile

Bug #23121 » 15034_v5.diff

Administrator Admin, 2010-07-15 07:37

View differences:

t3lib/class.t3lib_div.php (working copy)
$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://').
(10-10/15)