Skip to content

Commit 919ad3e

Browse files
committed
Make info file scan more strict
1 parent fd1d0ed commit 919ad3e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Project.php

+4-3
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ function($path) {
5555
return false;
5656
}
5757
$parts = explode('.', basename($path));
58-
if (end($parts) === 'info'
59-
|| array_slice($parts, -2) == ['info', 'yml']
58+
if (($this->core == 7 && end($parts) === 'info')
59+
|| ($this->core == 8 && array_slice($parts, -2) == ['info', 'yml'])
6060
) {
6161
$this->infoFiles[] = $path;
6262

@@ -106,10 +106,11 @@ function($path) {
106106
$top = isset($composerMap[$this->name])
107107
? $this->name
108108
: current(array_keys($composerMap));
109+
$info = isset($projectMap[$top]) ? $projectMap[$top] : null;
109110
if ('drupal' === $this->name) {
110111
$composerMap[$top]['type'] = 'drupal-core';
111112
}
112-
if (empty($composerMap[$top]['type']) && $this->core == 8) {
113+
if (empty($composerMap[$top]['type']) && $this->core == 8 && isset($info) && isset($info->drupalInfo()['type'])) {
113114
$composerMap[$top]['type'] = 'drupal-' . $info->drupalInfo()['type'];
114115
}
115116
if (empty($composerMap[$top]['type']) && $releaseInfo = $this->getReleaseInfo($this->core)) {

0 commit comments

Comments
 (0)