mirror of
https://github.com/wintercms/winter.git
synced 2024-06-28 05:33:29 +02:00
Add support for file names with multiple dots (#4211)
Fixes #4210. Credit to @GinoPane
This commit is contained in:
parent
3363b219f6
commit
8606db9e77
@ -530,7 +530,7 @@ class VersionManager
|
||||
protected function extractScriptsAndComments($details)
|
||||
{
|
||||
if (is_array($details)) {
|
||||
$fileNamePattern = '/^[a-z_\-0-9]*\.php$/i';
|
||||
$fileNamePattern = '/^[a-z_\-0-9\.]*\.php$/i';
|
||||
|
||||
$comments = array_values(array_filter($details, function ($detail) use ($fileNamePattern) {
|
||||
return !preg_match($fileNamePattern, $detail);
|
||||
@ -545,5 +545,5 @@ class VersionManager
|
||||
}
|
||||
|
||||
return array($comments, $scripts);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -170,6 +170,22 @@ class VersionManagerTest extends TestCase
|
||||
'scripts_can_go_first.php',
|
||||
'scripts_can_go_anywhere.php'
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
'file.name.with.dots.php',
|
||||
'The first update comment',
|
||||
'1.0.2.scripts_can_go_anywhere.php',
|
||||
'The second update comment',
|
||||
],
|
||||
[
|
||||
'The first update comment',
|
||||
'The second update comment'
|
||||
],
|
||||
[
|
||||
'file.name.with.dots.php',
|
||||
'1.0.2.scripts_can_go_anywhere.php'
|
||||
]
|
||||
]
|
||||
];
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user