소스 검색

Guard against arrays being passed to is_file, fixes #1627

Jordi Boggiano 12 년 전
부모
커밋
9f961dca92
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/Composer/Downloader/ArchiveDownloader.php

+ 1 - 1
src/Composer/Downloader/ArchiveDownloader.php

@@ -57,7 +57,7 @@ abstract class ArchiveDownloader extends FileDownloader
                 $contentDir = $contentDir[0];
             }
 
-            if (is_file($contentDir)) {
+            if (is_string($contentDir) && is_file($contentDir)) {
                 $this->filesystem->rename($contentDir, $path . '/' . basename($contentDir));
             } else {
                 foreach (array_merge(glob($contentDir . '/.*'), glob($contentDir . '/*')) as $file) {