From 28c34128eeb70dd4ec1c7e736ffc9ee75a80e8c0 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Mon, 8 Nov 2021 15:03:05 +0100 Subject: [PATCH] Fix php proxies to resolve __FILE__ and __DIR__ using realpath on PHP <8, fixes #10261 --- src/Composer/Installer/BinaryInstaller.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Composer/Installer/BinaryInstaller.php b/src/Composer/Installer/BinaryInstaller.php index 91be81b54..084bef18a 100644 --- a/src/Composer/Installer/BinaryInstaller.php +++ b/src/Composer/Installer/BinaryInstaller.php @@ -291,6 +291,7 @@ if (PHP_VERSION_ID < 80000) { { // get rid of composer-bin-proxy:// prefix for __FILE__ & __DIR__ resolution \$opened_path = substr(\$path, 21); + \$opened_path = realpath(\$opened_path) ?: \$opened_path; \$this->handle = fopen(\$opened_path, \$mode); \$this->position = 0;