Explorar o código

Fix regex escaping, fixes #5674

Jordi Boggiano %!s(int64=8) %!d(string=hai) anos
pai
achega
ec2660fe78
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/Composer/EventDispatcher/EventDispatcher.php

+ 1 - 1
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;