diff options
author | Mario <mario@mariovavti.com> | 2024-06-17 08:52:01 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2024-06-17 08:52:01 +0000 |
commit | 0097840e3294f70f1c6729731d23405e2359c950 (patch) | |
tree | 08fc0c476b8b2652fcf6b16cb3861e5279da791c /include | |
parent | 082b615e506ee9eb77680598f6ee0be982ef0429 (diff) | |
parent | 62cbd87e71591bdd4c04f8cad07d6395d7f206c2 (diff) | |
download | volse-hubzilla-0097840e3294f70f1c6729731d23405e2359c950.tar.gz volse-hubzilla-0097840e3294f70f1c6729731d23405e2359c950.tar.bz2 volse-hubzilla-0097840e3294f70f1c6729731d23405e2359c950.zip |
Merge branch 'misc-fixes' into 'dev'
Add module test helper expectRedirectTo + api docs
See merge request hubzilla/core!2138
Diffstat (limited to 'include')
-rw-r--r-- | include/network.php | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/include/network.php b/include/network.php index bb5bc1ce7..b3a3d715c 100644 --- a/include/network.php +++ b/include/network.php @@ -556,12 +556,15 @@ function z_dns_check($h,$check_mx = 0) { return((@dns_get_record($h,$opts) || filter_var($h, FILTER_VALIDATE_IP)) ? true : false); } -function is_local_url($url) { - if (str_starts_with($url, z_root()) || str_starts_with($url, '/')) { - return true; - } - - return false; +/** + * Returns whether an URL is local to the site, or not. + * + * @param string $url The URL to check + * + * @return bool True if the URL is local, false otherwise. + */ +function is_local_url(string $url): bool { + return str_starts_with($url, z_root()) || str_starts_with($url, '/'); } /** |