Additional zip fixes for Windows

This commit is contained in:
Chris Kankiewicz
2020-02-26 11:41:03 -07:00
parent ad37a462fe
commit 14db8618c0

View File

@@ -94,7 +94,9 @@ class ZipHandler
*/
protected function stripPath(SplFileInfo $file, string $path): string
{
$pattern = sprintf('/^%s\/?/', preg_quote($path, '/'));
$pattern = sprintf(
'/^%s%s?/', preg_quote($path, '/'), preg_quote(DIRECTORY_SEPARATOR, '/')
);
return preg_replace($pattern, '', $file->getPathname());
}