1
0
Fork 0

Fix php proxies to resolve __FILE__ and __DIR__ using realpath on PHP <8, fixes #10261

pull/10262/head
Jordi Boggiano 2021-11-08 15:03:05 +01:00
parent 3bb78fd1ee
commit 28c34128ee
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 1 additions and 0 deletions

View File

@ -291,6 +291,7 @@ if (PHP_VERSION_ID < 80000) {
{ {
// get rid of composer-bin-proxy:// prefix for __FILE__ & __DIR__ resolution // get rid of composer-bin-proxy:// prefix for __FILE__ & __DIR__ resolution
\$opened_path = substr(\$path, 21); \$opened_path = substr(\$path, 21);
\$opened_path = realpath(\$opened_path) ?: \$opened_path;
\$this->handle = fopen(\$opened_path, \$mode); \$this->handle = fopen(\$opened_path, \$mode);
\$this->position = 0; \$this->position = 0;