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
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user