#85946Caching of GeneralUtility::getIndpEnv() does not work for NULL
Description
There is a cache that returns the result of GeneralUtility::getIndpEnv().
I was wondering why it didn’t have effect for my check on GeneralUtility::getIndpEnv(‘HTTP_HOST’) when being run on the command line.
Obviously, the HTTP_HOST var is not defined, therefore the result is always NULL.
The problem here is that the cache is checked using isset(), which returns FALSE if a variable is set but the value is NULL.
The solution is to check if there is a cached entry using array_key_exists().
Reviews 5
- main 58005[BUGFIX] Use runtime cache for getIndpEnv() for results which are NULL
- TYPO3_8-7 58006[BUGFIX] Use runtime cache for getIndpEnv() for results which are NULL
- TYPO3_7-6 58007[BUGFIX] Use runtime cache for getIndpEnv() for results which are NULL
- TYPO3_8-7 58115[TASK] typo3/testing-framework now flushes runtime caches
- main 58008[TASK] typo3/testing-framework now flushes runtime caches