Bug #89980

Numeric keys in $_SERVER array lead to type error

Added by Daniel Siepmann 2 months ago. Updated about 1 month ago.

Status:
Resolved
Priority:
Should have
Assignee:
-
Category:
-
Start date:
2019-12-17
Due date:
% Done:

100%

TYPO3 Version:
10
PHP Version:
7.3
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Calling whatever URL results in the following error:

TypeError

strpos() expects parameter 1 to be string, int given

In order to create the error the Variable $_SERVER['1'] can be set.

The error is created in in /home/daniels/Projects/own/website-typo3/project/private/typo3/sysext/core/Classes/Http/ServerRequestFactory.php line 101:

    protected static function prepareHeaders(array $server)
    {
        $headers = [];
        foreach ($server as $key => $value) {
            if (strpos($key, 'HTTP_COOKIE') === 0) {
                // Cookies are handled using the $_COOKIE superglobal
                continue;
            }

Associated revisions

Revision 07c83403 (diff)
Added by Daniel Siepmann about 1 month ago

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

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

Resolves: #89980
Releases: master
Change-Id: I4c22891a0a341b11cb6c9a42923dadeb45a07524
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/62736
Tested-by: TYPO3com <>
Tested-by: Susanne Moog <>
Tested-by: Felix P. <>
Tested-by: Alexander Schnitzler <>
Tested-by: Benni Mack <>
Reviewed-by: Susanne Moog <>
Reviewed-by: Felix P. <>
Reviewed-by: Alexander Schnitzler <>
Reviewed-by: Oliver Klee <>
Reviewed-by: Benni Mack <>

History

#1 Updated by Gerrit Code Review 2 months ago

  • Status changed from New to Under Review

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

#2 Updated by Gerrit Code Review 2 months ago

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/c/Packages/TYPO3.CMS/+/62736

#3 Updated by Gerrit Code Review 2 months 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/c/Packages/TYPO3.CMS/+/62736

#4 Updated by Gerrit Code Review about 1 month ago

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

#5 Updated by Daniel Siepmann about 1 month ago

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

Also available in: Atom PDF