Skip to content

Commit

Permalink
Avoid the possibility of treating a dir named composer as a file.
Browse files Browse the repository at this point in the history
In case a path in the `PATH` environment variable contains a directory
named `composer`, it might be use as the alleged composer "executable"
as `file_exists` returns `true` for directories.
  • Loading branch information
ndm2 committed Jun 11, 2014
1 parent 7fe246d commit 47e7a55
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Console/Command/Task/ProjectTask.php
Expand Up @@ -121,7 +121,7 @@ protected function _searchPath($path) {
$composer = ['composer.phar', 'composer'];
foreach ($path as $dir) {
foreach ($composer as $cmd) {
if (file_exists($dir . DS . $cmd)) {
if (is_file($dir . DS . $cmd)) {
$this->_io->verbose('Found composer executable in ' . $dir);
return $dir . DS . $cmd;
}
Expand Down

0 comments on commit 47e7a55

Please sign in to comment.