Skip to content

Gate curl_escape/curl_unescape on extension_loaded('curl') (#13588) - #14025

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-13588-curl-escape-phantom
Jun 30, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-13588-curl-escape-phantom

Conversation

@PurHur

@PurHur PurHur commented Jun 30, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add CurlExtensionPolicy::advertisesBuiltins() mirroring IntlExtensionPolicy — withhold curl_escape() / curl_unescape() from function_exists() until extension_loaded('curl') is true (Stdlib: ext/curl — curl_init/exec/getinfo and HTTP client API (ext/curl parity) #3325 client).
  • php-src reference: ext/curl/interface.c — PHP_FUNCTION(curl_escape) requires CurlHandle.
  • PHP implementation: ext/curl/CurlExtensionPolicy.php, ext/curl/Module.php.

Closes #13588

Verification

php bin/vm.php test/repro/maintainer_gap_curl_escape_phantom_signature.php
# ok

php bin/vm.php -r "echo (int)function_exists('curl_escape');"
# 0

./vendor/bin/phpunit test/unit/CurlModuleTest.php test/unit/CurlExtensionPolicyTest.php test/unit/CurlEscapeBuiltinTest.php
# OK

php bin/compile.php -l test/repro/maintainer_gap_curl_escape_phantom_signature.php
# exit 0

Made with Cursor

Withhold curl URL-encode helpers from function_exists() until ext/curl is
loaded, matching php-src ext/curl/interface.c and the intl grapheme pattern.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stdlib: curl_escape()/curl_unescape() — 1-arg phantom API without ext/curl; php-src requires CurlHandle (ext/curl/interface.c)

1 participant