Skip to content

Commit 37de7ca

Browse files
author
arnoson
committed
Merge branch 'main' of github.com:arnoson/kirby-vite into main
2 parents a0c8be3 + 4f25de5 commit 37de7ca

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

lib/Vite.php

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace arnoson\KirbyVite;
44

5+
use Kirby\Http\Url;
56
use Kirby\Toolkit\F;
67
use Kirby\Toolkit\Str;
78
use \Exception;
@@ -26,15 +27,7 @@ public static function getInstance() {
2627
* sanitizeDir('test') // => '/test'
2728
*/
2829
protected function sanitizeDir(string $dir): string {
29-
if (!Str::startsWith($dir, '/')) {
30-
$dir = "/{$dir}";
31-
}
32-
33-
if (Str::endsWith($dir, '/')) {
34-
$dir = substr($dir, 0, -1);
35-
}
36-
37-
return $dir;
30+
return Url::path($dir, true, false);
3831
}
3932

4033
/**

0 commit comments

Comments
 (0)