[BUGFIX] Invalid use of array_shift() in t3lib_div
authorXavier Perseguers <xavier@typo3.org>
Mon, 19 Sep 2011 20:58:53 +0000 (22:58 +0200)
committerXavier Perseguers <xavier@typo3.org>
Mon, 19 Sep 2011 21:02:22 +0000 (23:02 +0200)
PHP Runtime Notice: Only variables should be passed by reference.

Change-Id: Ib1e9af4b58202f085d1afbba2b9bd0b288a8ef58
Fixes: #30056
Releases: 4.6
Reviewed-on: http://review.typo3.org/5083
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
t3lib/class.t3lib_div.php

index 0002155..606fef8 100644 (file)
@@ -3642,7 +3642,8 @@ final class t3lib_div {
                        case 'TYPO3_HOST_ONLY':
                                $httpHost = self::getIndpEnv('HTTP_HOST');
                                $httpHostBracketPosition = strpos($httpHost, ']');
-                               $retVal = ($httpHostBracketPosition !== FALSE) ? substr($httpHost, 0, ($httpHostBracketPosition + 1)) : array_shift(explode(':', $httpHost));
+                               $httpHostParts = explode(':', $httpHost);
+                               $retVal = ($httpHostBracketPosition !== FALSE) ? substr($httpHost, 0, ($httpHostBracketPosition + 1)) : array_shift($httpHostParts);
                                break;
                        case 'TYPO3_PORT':
                                $httpHost = self::getIndpEnv('HTTP_HOST');