From ec2660fe78ca40ff4415f5dd1a00a721b2e6df56 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Tue, 13 Sep 2016 16:18:05 +0200 Subject: [PATCH] Fix regex escaping, fixes #5674 --- src/Composer/EventDispatcher/EventDispatcher.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Composer/EventDispatcher/EventDispatcher.php b/src/Composer/EventDispatcher/EventDispatcher.php index 0c9d6466a..2dc547959 100644 --- a/src/Composer/EventDispatcher/EventDispatcher.php +++ b/src/Composer/EventDispatcher/EventDispatcher.php @@ -226,7 +226,7 @@ class EventDispatcher $possibleLocalBinaries = $this->composer->getPackage()->getBinaries(); if ($possibleLocalBinaries) { foreach ($possibleLocalBinaries as $localExec) { - if (preg_match("/\b${callable}$/", $localExec)) { + if (preg_match('{\b'.preg_quote($callable).'$}', $localExec)) { $caller = BinaryInstaller::determineBinaryCaller($localExec); $exec = preg_replace('{^'.preg_quote($callable).'}', $caller . ' ' . $localExec, $exec); break;