From 79813b2f7772cb6bf6a7b066fd1743a337ddd3eb Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Thu, 30 Jul 2020 14:24:04 +0200 Subject: [PATCH] Fix detection of git refs to be more strict --- src/Composer/Repository/Vcs/VcsDriver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Composer/Repository/Vcs/VcsDriver.php b/src/Composer/Repository/Vcs/VcsDriver.php index 37946da23..f174f8527 100644 --- a/src/Composer/Repository/Vcs/VcsDriver.php +++ b/src/Composer/Repository/Vcs/VcsDriver.php @@ -81,7 +81,7 @@ abstract class VcsDriver implements VcsDriverInterface */ protected function shouldCache($identifier) { - return $this->cache && preg_match('{[a-f0-9]{40}}i', $identifier); + return $this->cache && preg_match('{^[a-f0-9]{40}$}iD', $identifier); } /**