From 186d640c8fdf3f36149dd26462976468ccd690fd Mon Sep 17 00:00:00 2001 From: KJ Date: Thu, 9 May 2024 23:10:58 -0400 Subject: [PATCH] fix: an empty SITE_URL return a incorrect value of basePath. --- src/Libs/Router.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Libs/Router.php b/src/Libs/Router.php index 10f0231..38c3187 100644 --- a/src/Libs/Router.php +++ b/src/Libs/Router.php @@ -82,7 +82,7 @@ class Router { */ public static function basePath(): string { - if (defined('SITE_URL')) + if (defined('SITE_URL') && !empty(SITE_URL)) return parse_url(SITE_URL, PHP_URL_PATH); return str_replace($_SERVER['DOCUMENT_ROOT'], '/', ROOT_DIR); }