Review main Merged

62736[BUGFIX] Don't break on numeric $_SERVER keys

Daniel Siepmann CR +2 V +2 Easy +19 −0 updated 01/16/20, 14:37

Commit message

Prevent PHP TypeError when creating request from globals containing
numeric keys.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Oliver Klee +1
    • Alexander Schnitzler +1
    • Felix P. +1
    • Susi Moog +1
  • Verified V +2 Done
    • Benni Mack +2
    • Alexander Schnitzler +1
    • Felix P. +1
    • Susi Moog +1
    • TYPO3com +1 CI

Issues 1

Files 2

Review log 1721

  1. Daniel Siepmann uploaded patch set 1 12/17/19, 21:23

  2. TYPO3com voted on patch set 1 V -1 12/17/19, 21:24 Completed build in 17s on Tue, 17 Dec, 09:24 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-39493

  3. Daniel Siepmann uploaded patch set 2 12/17/19, 21:25

  4. TYPO3com voted on patch set 2 V +1 12/17/19, 21:33 Completed build in 08m 17s on Tue, 17 Dec, 09:33 PM Test Summary: 69301 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-39494

  5. Oliver Klee commented on patch set 2 12/17/19, 22:54

    ServerRequestFactory.php:101

    Shorter: if (!is_string($key))

    ServerRequestFactoryTest.php:211

    I propose to change the name to "handlesNumericKeys".
  6. Daniel Siepmann uploaded patch set 3 12/18/19, 07:11

  7. Daniel Siepmann commented on patch set 3 12/18/19, 07:12

    ServerRequestFactory.php:101 Reply

    Done

    ServerRequestFactoryTest.php:211 Reply

    Done
  8. TYPO3com voted on patch set 3 V +1 12/18/19, 07:19 Completed build in 07m 56s on Wed, 18 Dec, 07:19 AM Test Summary: 69301 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-39496

  9. Oliver Klee commented on patch set 3 CR -1 12/18/19, 08:39

    ServerRequestFactoryTest.php:215

    For this test to be meaningful, the key needs to be the int 1, not the string '1'.
  10. Oliver Klee commented on patch set 3 12/18/19, 09:11

    ServerRequestFactoryTest.php:215 Reply

    Also: Have you checked that this test fails without the fix?
  11. Daniel Siepmann commented on patch set 3 12/18/19, 09:19

    ServerRequestFactoryTest.php:215 Reply Unresolved

    In my local Setup, that's exactly what is happening. Like in POST or GET this are always strings. But PHP sometimes handles these as integers anyway due to internals. I've checked because I had the issue and therefore created the issue and fix.
  12. Alexander Schnitzler commented on patch set 3 12/20/19, 10:13

    ServerRequestFactory.php:101 Unresolved

    What I'd like even more here would be to have a clean array in the first place, even before this method, so we can use a proper doc type that defines the array more specific. It would help with static code analysis.
  13. Daniel Siepmann uploaded patch set 4 01/16/20, 13:13

  14. TYPO3com voted on patch set 4 V +1 01/16/20, 13:24 Completed build in 10m 28s on Thu, 16 Jan, 01:24 PM Test Summary: 70373 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-40041

  15. Susi Moog voted on patch set 4 V +1 CR +1 01/16/20, 13:25

  16. Felix P. commented on patch set 4 V +1 CR +1 01/16/20, 13:29

    ServerRequestFactory.php:101

    why are you not using is_numeric()?
  17. Daniel Siepmann commented on patch set 4 01/16/20, 13:47

    ServerRequestFactory.php:101 Reply Unresolved

    Because the following code expects strings. So everything not a string should be skipped.
  18. Alexander Schnitzler voted on patch set 4 V +1 CR +1 01/16/20, 14:05

  19. Oliver Klee voted on patch set 4 CR +1 01/16/20, 14:21

  20. Benni Mack voted on patch set 4 V +2 CR +2 01/16/20, 14:37

  21. Benni Mack merged patch set 5 01/16/20, 14:37