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
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -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));
+4 −0
Original line number Diff line number Diff line
@@ -111,6 +111,10 @@ class ProjectUnitTest extends TestCase
                'invalid',
                8,
            ],
            [
                __DIR__.'/directory.info/test.php',
                8,
            ],
        ];

    }//end coreVersionProvider()
+5 −0
Original line number Diff line number Diff line
<?php

/**
 * Intentionally empty.
 */