From 9fa8a02fe3113a41b67913659e52f56ab96994bd Mon Sep 17 00:00:00 2001 From: jalgaba Date: Fri, 28 Sep 2018 05:25:50 -0700 Subject: [PATCH] Fix broken sample links on windows due to $baseDir having backslash (#653) --- src/PhpSpreadsheet/Helper/Sample.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PhpSpreadsheet/Helper/Sample.php b/src/PhpSpreadsheet/Helper/Sample.php index 54e0e2988e..e199c807c0 100644 --- a/src/PhpSpreadsheet/Helper/Sample.php +++ b/src/PhpSpreadsheet/Helper/Sample.php @@ -82,7 +82,7 @@ public function getSamples() $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']));