Skip to content

Commit 15692fc

Browse files
committed
resolveFilePath(PathUtility): handle absolute path cleanly
1 parent 8f55dae commit 15692fc

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/Utility/PathUtility.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,9 @@ public static function resolveFilePath(string $filePath): string
9393
return $filePath;
9494
}
9595

96-
if (!self::isAbsolutePath($filePath)) {
97-
$filePath = self::getAbsolutePath($filePath);
98-
}
99-
100-
if (file_exists($filePath)) {
101-
return $filePath;
96+
$absolutePath = self::isAbsolutePath($filePath) ? $filePath : self::getAbsolutePath($filePath);
97+
if (file_exists($absolutePath)) {
98+
return $absolutePath;
10299
}
103100

104101
$altPath1 = $_SERVER['DOCUMENT_ROOT'] . $filePath;

0 commit comments

Comments
 (0)