Skip to content

Conversation

nikic
Copy link
Member

@nikic nikic commented Jul 18, 2019

php_resolve_path() / stream_resolve_include_path() are supposed to return the path that will be included by include -- for stream wrappers that should just be a no-op (if the file exists).

This also makes opcache_invalidate() work and solves the issue in #4392. Does anyone see an issue with doing this?

@nikic
Copy link
Member Author

nikic commented Jul 18, 2019

========DIFF========
002+ 
002- DYNAMIC INCLUDE
003+ Warning: include(php://filter/read=string.toupper/resource=bug64482.inc): failed to open stream: operation failed in /home/travis/build/nikic/php-src/ext/opcache/tests/bug64482.php on line 4
004+ 
005+ Warning: include(): Failed opening 'php://filter/read=string.toupper/resource=bug64482.inc' for inclusion (include_path='.:') in /home/travis/build/nikic/php-src/ext/opcache/tests/bug64482.php on line 4
========DONE========
FAIL Bug #64482 (Opcodes for dynamic includes should not be cached) [ext/opcache/tests/bug64482.phpt] 

Looks like php_stream_open_wrapper may also use php_resolve_path and that use assumes that it returns NULL for stream wrappers...

I think there's some subtleties here that I'm not really familiar with, not going to pursue this.

@dktapps
Copy link
Contributor

dktapps commented Nov 25, 2021

What about only allowing resolving for file:// and phar://? That would cover most common use cases.

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.

2 participants