Skip to content

Commit 01d0b6c

Browse files
committed
fix: add try/catch ValueError from real_path()
1 parent 6e5a9cb commit 01d0b6c

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

system/Common.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,11 @@ function cache(?string $key = null)
9090
function clean_path(string $path): string
9191
{
9292
// Resolve relative paths
93-
$path = realpath($path) ?: $path;
93+
try {
94+
$path = realpath($path) ?: $path;
95+
} catch (ErrorException|ValueError $e) {
96+
$path = 'error file path: ' . urlencode($path);
97+
}
9498

9599
switch (true) {
96100
case strpos($path, APPPATH) === 0:

0 commit comments

Comments
 (0)