Fix EventDispatcher on windows picking bat files when using "@php binary", fixes #11490
parent
902a153741
commit
3ae662f4c7
|
@ -351,6 +351,14 @@ class EventDispatcher
|
|||
if ($matched && !file_exists($match[0])) {
|
||||
$finder = new ExecutableFinder;
|
||||
if ($pathToExec = $finder->find($match[0])) {
|
||||
if (Platform::isWindows()) {
|
||||
$execWithoutExt = Preg::replace('{\.(exe|bat|cmd|com)$}i', '', $pathToExec);
|
||||
// prefer non-extension file if it exists when executing with PHP
|
||||
if (file_exists($execWithoutExt)) {
|
||||
$pathToExec = $execWithoutExt;
|
||||
}
|
||||
unset($execWithoutExt);
|
||||
}
|
||||
$pathAndArgs = $pathToExec . substr($pathAndArgs, strlen($match[0]));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue