fix: an empty SITE_URL return a incorrect value of basePath.
This commit is contained in:
parent
c65fcd27c8
commit
186d640c8f
@ -82,7 +82,7 @@ class Router {
|
|||||||
*/
|
*/
|
||||||
public static function basePath(): string
|
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 parse_url(SITE_URL, PHP_URL_PATH);
|
||||||
return str_replace($_SERVER['DOCUMENT_ROOT'], '/', ROOT_DIR);
|
return str_replace($_SERVER['DOCUMENT_ROOT'], '/', ROOT_DIR);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user