Project

General

Profile

Bug #85946

Updated by Michael Stucki over 5 years ago

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 will be NULL. 

 The problem here is that the cache is checked using isset(), which returns FALSE if a variable is set isset but the value is NULL. 
 The solution is to check if there is a cached entry using array_key_exists().

Back