Skip to content

Commit fd1adb4

Browse files
fix: path formatting
1 parent 2ddfc43 commit fd1adb4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/kirby-vite/Vite.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
use \Exception;
66

77
function getRelativePath($rootPath, $fullPath) {
8-
$rootPath = rtrim($rootPath, '/');
9-
$fullPath = rtrim($fullPath, '/');
8+
$rootPath = realpath(rtrim($rootPath, '/'));
9+
$fullPath = realpath(rtrim($fullPath, '/'));
1010

1111
if (strpos($fullPath, $rootPath) === 0) {
12-
$relativePath = ltrim(substr($fullPath, strlen($rootPath)), '/');
12+
$relativePath = ltrim(substr($fullPath, strlen($rootPath)), DIRECTORY_SEPARATOR);
1313
return $relativePath;
1414
}
1515

0 commit comments

Comments
 (0)