diff --git a/modules/system/classes/VersionManager.php b/modules/system/classes/VersionManager.php index bd18f82da..98f21a830 100644 --- a/modules/system/classes/VersionManager.php +++ b/modules/system/classes/VersionManager.php @@ -530,7 +530,7 @@ class VersionManager protected function extractScriptsAndComments($details) { if (is_array($details)) { - $fileNamePattern = '/^[a-z_\-0-9\.]*\.php$/i'; + $fileNamePattern = "/^[a-z0-9\_\-\.\/\\\]+\.php$/i"; $comments = array_values(array_filter($details, function ($detail) use ($fileNamePattern) { return !preg_match($fileNamePattern, $detail); diff --git a/tests/unit/system/classes/VersionManagerTest.php b/tests/unit/system/classes/VersionManagerTest.php index 7cf87a338..b9934d3e5 100644 --- a/tests/unit/system/classes/VersionManagerTest.php +++ b/tests/unit/system/classes/VersionManagerTest.php @@ -186,6 +186,22 @@ class VersionManagerTest extends TestCase 'file.name.with.dots.php', '1.0.2.scripts_can_go_anywhere.php' ] + ], + [ + [ + 'subdirectory/file.name.with.dots.php', + 'The first update comment', + 'subdirectory\1.0.2.scripts_can_go_anywhere.php', + 'The second update comment', + ], + [ + 'The first update comment', + 'The second update comment' + ], + [ + 'subdirectory/file.name.with.dots.php', + 'subdirectory\1.0.2.scripts_can_go_anywhere.php' + ] ] ]; }