Issue Bug Closed

#89980Numeric keys in $_SERVER array lead to type error

Daniel Siepmann 12/17/19, 22:16 updated 02/27/20, 12:42

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;
            }

Reviews 1

History 26

  1. Gerrit Code Review pushed patch set 1 for master to change 62736 status New Under Review 12/17/19, 22:24

  2. Gerrit Code Review pushed patch set 2 for master to change 62736 12/17/19, 22:25

  3. Gerrit Code Review pushed patch set 3 for master to change 62736 12/18/19, 08:11

  4. Gerrit Code Review pushed patch set 4 for master to change 62736 01/16/20, 14:14

  5. Daniel Siepmann commented and changed status Under Review Resolved done 0 % 100 % 01/16/20, 16:00

    Applied in changeset commit:07c83403b9261ddcdcf98f3faf5a01be6cc09e25.

  6. Benni Mack changed status Resolved Closed 02/27/20, 12:42