From ba2d5727ed2c39194cd48a29f3e16311f9fbc56b Mon Sep 17 00:00:00 2001 From: Austin Drummond Date: Thu, 1 May 2025 21:59:37 -0400 Subject: [PATCH] Update CraftValetDriver.php When applying https://github.com/craftcms/security-patches to a Craft project, the fix for [CVE-2024-56145](https://github.com/advisories/GHSA-2p6p-9rc9-62j9) breaks sites served by Valet (and Herd). This fix allows these sites to work when using Valet (and Herd). --- cli/Valet/Drivers/Specific/CraftValetDriver.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cli/Valet/Drivers/Specific/CraftValetDriver.php b/cli/Valet/Drivers/Specific/CraftValetDriver.php index cd7d84f..14078d3 100644 --- a/cli/Valet/Drivers/Specific/CraftValetDriver.php +++ b/cli/Valet/Drivers/Specific/CraftValetDriver.php @@ -193,6 +193,10 @@ public function frontControllerPath(string $sitePath, string $siteName, string $ $_SERVER['PHP_SELF'] = $scriptName; $_SERVER['DOCUMENT_ROOT'] = $sitePath.'/'.$frontControllerDirectory; + if (isset($_SERVER['argv'])) { + unset($_SERVER['argv']); + } + return $indexPath; } }