Skip to content
Snippets Groups Projects
Unverified Commit da0d58cd authored by Klaus Purer's avatar Klaus Purer Committed by GitHub
Browse files

fix(ProjectDetection): Ignore directory names when detecting the Drupal core version (#3097367)

parent 4d111785
Branches
Tags
No related merge requests found
......@@ -94,6 +94,14 @@ class Project
$infoFiles = glob("$dir/*.info");
}
// Filter out directories.
$infoFiles = array_filter(
$infoFiles,
function ($fileName) {
return is_file($fileName);
}
);
// Go one directory up if we do not find an info file here.
$dir = dirname($dir);
} while (empty($infoFiles) === true && $dir !== dirname($dir));
......
......@@ -111,6 +111,10 @@ class ProjectUnitTest extends TestCase
'invalid',
8,
],
[
__DIR__.'/directory.info/test.php',
8,
],
];
}//end coreVersionProvider()
......
<?php
/**
* Intentionally empty.
*/
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment