aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2024-06-17 08:52:01 +0000
committerMario <mario@mariovavti.com>2024-06-17 08:52:01 +0000
commit0097840e3294f70f1c6729731d23405e2359c950 (patch)
tree08fc0c476b8b2652fcf6b16cb3861e5279da791c /include
parent082b615e506ee9eb77680598f6ee0be982ef0429 (diff)
parent62cbd87e71591bdd4c04f8cad07d6395d7f206c2 (diff)
downloadvolse-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.php15
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, '/');
}
/**