Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CURLOPT_HTTPHEADER should not accept a dictionary #9263

Closed
johnbillion opened this issue May 1, 2023 · 3 comments
Closed

CURLOPT_HTTPHEADER should not accept a dictionary #9263

johnbillion opened this issue May 1, 2023 · 3 comments

Comments

@johnbillion
Copy link
Contributor

johnbillion commented May 1, 2023

Bug report

The curl_setopt() additions in phpstan/phpstan-src#1719 are very useful, thanks (cc @staabm). Coincidentally just last week I fixed a bug where headers were being sent to curl as a dictionary instead of a list, which is incorrect.

curl_setopt($curl, CURLOPT_HTTPHEADER, $headers) should only allow a numerically indexed array as the third parameter.

Code snippet that reproduces the problem

https://phpstan.org/r/fc00207b-efa7-4d83-adc0-01d874035272

Expected output

Line 8 in the code snippet should produce an error stating that only a list is accepted.

Did PHPStan help you today? Did it make you happy in any way?

I can no longer write PHP without PHPStan.

@mergeable
Copy link

mergeable bot commented May 1, 2023

This bug report is missing a link to reproduction at phpstan.org/try.

It will most likely be closed after manual review.

@ondrejmirtes
Copy link
Member

Fixed: phpstan/phpstan-src#2369

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants