Project

General

Profile

Actions

Bug #85946

closed

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

Added by Michael Stucki over 5 years ago. Updated over 5 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 #1

Updated by Gerrit Code Review over 5 years ago

  • Status changed from New to Under Review

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58005

Actions #2

Updated by Michael Stucki over 5 years ago

  • Description updated (diff)
Actions #3

Updated by Gerrit Code Review over 5 years ago

Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58006

Actions #4

Updated by Gerrit Code Review over 5 years ago

Patch set 1 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58007

Actions #5

Updated by Gerrit Code Review over 5 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58005

Actions #6

Updated by Gerrit Code Review over 5 years ago

Patch set 2 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58006

Actions #7

Updated by Gerrit Code Review over 5 years ago

Patch set 3 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58006

Actions #8

Updated by Michael Stucki over 5 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #9

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF