Fix broken sample links on windows due to $baseDir having backslash (#653)

This commit is contained in:
jalgaba 2018-09-28 05:25:50 -07:00 committed by Adrien Crivelli
parent a98d885830
commit 9fa8a02fe3
1 changed files with 1 additions and 1 deletions

View File

@ -82,7 +82,7 @@ class Sample
$files = []; $files = [];
foreach ($regex as $file) { foreach ($regex as $file) {
$file = str_replace($baseDir . '/', '', $file[0]); $file = str_replace(str_replace('\\', '/', $baseDir) . '/', '', str_replace('\\', '/', $file[0]));
$info = pathinfo($file); $info = pathinfo($file);
$category = str_replace('_', ' ', $info['dirname']); $category = str_replace('_', ' ', $info['dirname']);
$name = str_replace('_', ' ', preg_replace('/(|\.php)/', '', $info['filename'])); $name = str_replace('_', ' ', preg_replace('/(|\.php)/', '', $info['filename']));