From c6cc9d416495ea306b004f12ad7cb89c96de9162 Mon Sep 17 00:00:00 2001 From: wolfcode <37436228+wolf-leo@users.noreply.github.com> Date: Mon, 16 Dec 2024 13:51:27 +0800 Subject: [PATCH] feat(common): add support for absolute URLs in __url function - Implement a check for absolute URLs using filter_var with FILTER_VALIDATE_URL - If the provided URL is an absolute URL, it is returned as is - This enhancement allows the __url function to handle both relative and absolute URLs --- app/common.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/common.php b/app/common.php index 9084688..2d8cb8d 100644 --- a/app/common.php +++ b/app/common.php @@ -19,6 +19,7 @@ if (!function_exists('__url')) { */ function __url(string $url = '', array $vars = [], bool $suffix = true, bool $domain = false): string { + if (filter_var($url, FILTER_VALIDATE_URL)) return $url; return url($url, $vars, $suffix, $domain)->build(); } }