From 39e8a3322f974c5f682677cdd3a67e923b47cb57 Mon Sep 17 00:00:00 2001 From: Robert Date: Sun, 30 Jul 2023 21:00:55 -0400 Subject: [PATCH] check realpath for false returns --- src/bootstrap/requires.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/bootstrap/requires.php b/src/bootstrap/requires.php index 6708772..48749b5 100644 --- a/src/bootstrap/requires.php +++ b/src/bootstrap/requires.php @@ -76,7 +76,13 @@ final class requires { } $dir = str_replace('_DS_', '/', $dir); $dir = self::filter_dir_path($dir); - $dir = escapeshellcmd(realpath($dir)); + + $realpath = realpath($dir); + if ($realpath === false) { + return false; + } + + $dir = escapeshellcmd(realpath($realpath)); return (file_exists($dir)) ? $dir : false; }