Skip to content

Fix file_get_contents() php://filter read filter chains (#13741) - #13746

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-13741-php-filter-read-chain
Jun 29, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-13741-php-filter-read-chain

Conversation

@PurHur

@PurHur PurHur commented Jun 29, 2026

Copy link
Copy Markdown
Owner

Summary

  • Route php://filter/read=…/resource=… through VmFs::readPathContentsViaOpen() so file_get_contents() applies registered read filters (php-src ext/standard/streams.c).
  • Add convert.quoted-printable-decode / convert.quoted-printable-encode to the built-in filter chain (VmStreamFilterChain).

Verification

php test/repro/maintainer_gap_php_filter_read_chain.php
php bin/vm.php test/repro/maintainer_gap_php_filter_read_chain.php
# four ok:… lines

./script/docker-exec.sh -- bash -lc './vendor/bin/phpunit --filter php_filter_read_chain'
# OK (4 tests)

./script/docker-exec.sh -- bash -lc 'php bin/compile.php -l test/repro/maintainer_gap_php_filter_read_chain.php'
# AOT lint OK

Closes #13741

Made with Cursor

Route php://filter URIs through fopen + read filters like php-src streams.c,
and implement convert.quoted-printable-* in the built-in filter chain.

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.

Regression: file_get_contents(php://filter/…) — filter chains return false not transformed body (ext/standard/streams.c)

1 participant