Project

General

Profile

Actions

Bug #85946

closed

Caching of GeneralUtility::getIndpEnv() does not work for NULL

Added by Michael Stucki over 6 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2018-08-23
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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().

Actions

Also available in: Atom PDF