diff --git a/src/PhpSpreadsheet/Helper/Sample.php b/src/PhpSpreadsheet/Helper/Sample.php index 54e0e298..e199c807 100644 --- a/src/PhpSpreadsheet/Helper/Sample.php +++ b/src/PhpSpreadsheet/Helper/Sample.php @@ -82,7 +82,7 @@ class Sample $files = []; foreach ($regex as $file) { - $file = str_replace($baseDir . '/', '', $file[0]); + $file = str_replace(str_replace('\\', '/', $baseDir) . '/', '', str_replace('\\', '/', $file[0])); $info = pathinfo($file); $category = str_replace('_', ' ', $info['dirname']); $name = str_replace('_', ' ', preg_replace('/(|\.php)/', '', $info['filename']));