Skip to content
Snippets Groups Projects
Commit 3e27e566 authored by Christian Kuhn's avatar Christian Kuhn Committed by Anja Leichsenring
Browse files

[BUGFIX] Let GeneralUtility::getIndpEnv() return string more often

We unfortunately still didn't manage to drop remaining
usages of GeneralUtility::getIndpEnv() and deprecate
the method in v11.

So we have to harden it a bit towards better PHP
compatibility: The method states it always returns
string, but it doesn't. Especially HTTP_HOST and
REMOTE_ADDR tend to return null. This isn't critical
since that's usually just triggered by tests, but
still, these calls should fall back to empty string
instead of null. The return values are often further
processed with string related methods, both in
getIndpEnv() itself, in other consumers, and in
other helper methods like cmpIp(). It absolutely
makes sense to return empty string over null in
lowlevel getIndpEnv() directly.

Resolves: #95764
Releases: master
Change-Id: I008452bb8445f1c23f634312d205102e4bb7602d
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/71966


Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarJochen <rothjochen@gmail.com>
Tested-by: default avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: default avatarBenni Mack <benni@typo3.org>
Reviewed-by: default avatarJochen <rothjochen@gmail.com>
Reviewed-by: default avatarOliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: default avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
parent cf1a8900
Branches
Tags
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment