diff --git a/typo3/sysext/core/Classes/Utility/GeneralUtility.php b/typo3/sysext/core/Classes/Utility/GeneralUtility.php index fa25704..f664d9e 100644 --- a/typo3/sysext/core/Classes/Utility/GeneralUtility.php +++ b/typo3/sysext/core/Classes/Utility/GeneralUtility.php @@ -3232,7 +3232,7 @@ Connection: close * Abstraction method which returns System Environment Variables regardless of server OS, CGI/MODULE version etc. Basically this is SERVER variables for most of them. * This should be used instead of getEnv() and $_SERVER/ENV_VARS to get reliable values for all situations. * - * @param string $getEnvName Name of the "environment variable"/"server variable" you wish to use. Valid values are SCRIPT_NAME, SCRIPT_FILENAME, REQUEST_URI, PATH_INFO, REMOTE_ADDR, REMOTE_HOST, HTTP_REFERER, HTTP_HOST, HTTP_USER_AGENT, HTTP_ACCEPT_LANGUAGE, QUERY_STRING, TYPO3_DOCUMENT_ROOT, TYPO3_HOST_ONLY, TYPO3_HOST_ONLY, TYPO3_REQUEST_HOST, TYPO3_REQUEST_URL, TYPO3_REQUEST_SCRIPT, TYPO3_REQUEST_DIR, TYPO3_SITE_URL, _ARRAY + * @param string $getEnvName Name of the "environment variable"/"server variable" you wish to use. Valid values are SCRIPT_NAME, SCRIPT_FILENAME, REQUEST_URI, PATH_INFO, REMOTE_ADDR, REMOTE_HOST, HTTP_REFERER, HTTP_HOST, HTTP_USER_AGENT, HTTP_ACCEPT_LANGUAGE, QUERY_STRING, TYPO3_DOCUMENT_ROOT, TYPO3_HOST_ONLY, TYPO3_HOST_ONLY, TYPO3_REQUEST_HOST, TYPO3_REQUEST_URL, TYPO3_REQUEST_SCRIPT, TYPO3_REQUEST_DIR, TYPO3_SITE_URL, TYPO3_DISABLE_CORE_UPDATER, _ARRAY * @return string Value based on the input key, independent of server/os environment. */ static public function getIndpEnv($getEnvName) { @@ -3464,6 +3464,9 @@ Connection: close $retVal = $_SERVER['SSL_SESSION_ID'] || strtolower($_SERVER['HTTPS']) === 'on' || (string)$_SERVER['HTTPS'] === '1' ? TRUE : FALSE; } break; + case 'TYPO3_DISABLE_CORE_UPDATER': + $retVal = self::getRedirectEnvironmentVariable($getEnvName); + break; case '_ARRAY': $out = array(); // Here, list ALL possible keys to this function for debug display. @@ -3502,6 +3505,26 @@ Connection: close } /** + * Returns an environment variable taking possible "REDIRECT_" + * prefixes into account (e.g. due to PHP running in CGI mode) + * + * The given environment variable will be prefixed at maximum of 5 times. + * + * @param string $environmentVariable the environment variable to retrieve + * @return mixed + */ + static protected function getRedirectEnvironmentVariable($environmentVariable) { + for ($prefixCount = 0; $prefixCount < 5; ++$prefixCount) { + $environmentVariableName = str_repeat('REDIRECT_', $prefixCount) . $environmentVariable; + + if (isset($_SERVER[$environmentVariableName])) { + return $_SERVER[$environmentVariableName]; + } + } + return NULL; + } + + /** * Gets the unixtime as milliseconds. * * @return integer The unixtime as milliseconds diff --git a/typo3/sysext/install/Classes/Service/CoreUpdateService.php b/typo3/sysext/install/Classes/Service/CoreUpdateService.php index 0c8e9f2..197a865 100644 --- a/typo3/sysext/install/Classes/Service/CoreUpdateService.php +++ b/typo3/sysext/install/Classes/Service/CoreUpdateService.php @@ -94,7 +94,7 @@ class CoreUpdateService { * @return boolean */ public function isCoreUpdateEnabled() { - return (getenv('TYPO3_DISABLE_CORE_UPDATER') !== '1'); + return (GeneralUtility::getIndpEnv('TYPO3_DISABLE_CORE_UPDATER') !== '1'); } /**