Skip to content

ext/curl: CURLOPT_FOLLOWLOCATION option handling. #18444

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

Closed
wants to merge 5 commits into from

Conversation

devnexen
Copy link
Member

it had been considered as boolean for years but since 8.13, it can accept values beyond 1L, respectively CURLFOLLOW_OBEYCODE and CURLFOLLOW_FIRSTONLY.

it had been considered as boolean for years but since 8.13, it can
accept values beyond 1L, respectively CURLFOLLOW_OBEYCODE and
CURLFOLLOW_FIRSTONLY.
@devnexen devnexen marked this pull request as ready for review April 27, 2025 19:48
@devnexen devnexen force-pushed the curl_followlocation_upd branch from b118a4b to 0d676b5 Compare April 27, 2025 21:15
--FILE--
<?php

for ($i = 0; $i <= CURLFOLLOW_FIRSTONLY; $i ++) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're making assumptions here about the specific values that these constants have. Unlikely to change, but not a fan to depend on this.
I propose to use a foreach loop with an array containing the values you want to test.

@devnexen devnexen closed this in ad65698 Apr 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants