[x] I was not able to find an open or closed issue matching what I'm seeing.
[X] This is not a question. (Questions should be asked on chat (Signup here) or our forums.)
For some estrange reason $_SERVER super-global could be populated with an integer key, making marshalHeadersFromSapi function to crash.
According to php manual integer keys are valid keys:
The key can either be an integer or a string. The value can be of any type.
Code to reproduce the issue
This happened on a Systemd + Nginx + php-pfm, trying to use sentry-symfony 3.2
To reproduce, add this line to the php-fpm pool config:
env[42] = testing
Expected results
To deal graciously with integer keys and not crash the request.
Actual results
Fatal error: Uncaught Symfony\Component\Debug\Exception\FatalThrowableError: Type error: strpos() expects parameter 1 to be string, int given in /opt/app/vendor/zendframework/zend-diactoros/src/functions/marshal_headers_from_sapi.php:28 Stack trace:
#0 /opt/app/vendor/zendframework/zend-diactoros/src/functions/marshal_headers_from_sapi.php(28): strpos(92, 'REDIRECT_')
#1 /opt/app/vendor/zendframework/zend-diactoros/src/ServerRequestFactory.php(64): Zend\Diactoros\marshalHeadersFromSapi(Array)
#2 /opt/app/vendor/sentry/sentry/src/Integration/RequestIntegration.php(101): Zend\Diactoros\ServerRequestFactory::fromGlobals()
#3 /opt/app/vendor/sentry/sentry/src/Integration/RequestIntegration.php(74): Sentry\Integration\RequestIntegration->processEvent(Object(Sentry\Event), Object(Sentry\Options))
#4 /opt/app/vendor/ in /opt/app/vendor/zendframework/zend-diactoros/src/functions/marshal_headers_from_sapi.php on line 28
For some estrange reason $_SERVER super-global could be populated with an integer key, making
marshalHeadersFromSapi
function to crash.According to php manual integer keys are valid keys:
Code to reproduce the issue
This happened on a Systemd + Nginx + php-pfm, trying to use sentry-symfony 3.2
To reproduce, add this line to the php-fpm pool config:
Expected results
To deal graciously with integer keys and not crash the request.
Actual results