Review main Merged

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

Christian Kuhn CR +2 V +2 Easy +4 −4 updated 10/25/21, 18:03

Commit message

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.

Review

  • Code review CR +2 Done
    • Anja Leichsenring +2
    • Jochen Roth +1
    • Oliver Klee +1
    • Benni Mack +1
  • Verified V +2 Done
    • Anja Leichsenring +2
    • Jochen Roth +1
    • core-ci +1 CI

Issues 1

Files 1

Review log 911

  1. Christian Kuhn uploaded patch set 1 10/25/21, 09:49

  2. Christian Kuhn updated the commit message in patch set 2 10/25/21, 09:55

  3. core-ci voted on patch set 1 V +1 10/25/21, 10:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/18518

  4. core-ci voted on patch set 2 V +1 10/25/21, 10:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/18520

  5. Oliver Klee commented on patch set 2 10/25/21, 10:15

    GeneralUtility.php:2403

    Should we also fix the return type annotation? string|bool|null (bool is the return type for TYPO3_SSL.)
  6. Benni Mack voted on patch set 2 CR +1 10/25/21, 12:23

  7. Christian Kuhn commented on patch set 2 10/25/21, 13:06

    GeneralUtility.php:2403 Reply

    thought about that, but decided to leave it out for now.
  8. Jochen Roth voted on patch set 2 V +1 CR +1 10/25/21, 15:47

  9. Oliver Klee voted on patch set 2 CR +1 10/25/21, 16:14

  10. Anja Leichsenring voted on patch set 2 V +2 CR +2 10/25/21, 18:03

  11. Anja Leichsenring merged patch set 3 10/25/21, 18:03