aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/controllers/terms.php2
-rw-r--r--lib/functions.php2
2 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/terms.php b/app/controllers/terms.php
index 528859a..9784a1c 100644
--- a/app/controllers/terms.php
+++ b/app/controllers/terms.php
@@ -71,7 +71,7 @@ class TermsController extends AuthenticatedController
{
$url = Config::get()->TERMS_OF_USE_URL;
- if (is_internal_url($url)) {
+ if ($url && is_internal_url($url)) {
$url_parts = explode('/', $url);
$detail_id = $url_parts[4];
$si = new Siteinfo();
diff --git a/lib/functions.php b/lib/functions.php
index 0849162..3198cb1 100644
--- a/lib/functions.php
+++ b/lib/functions.php
@@ -819,7 +819,7 @@ function is_internal_url($url)
return mb_strpos($url, $GLOBALS['ABSOLUTE_URI_STUDIP']) === 0;
}
- if ($url[0] === '/') {
+ if (str_starts_with($url, '/')) {
return mb_strpos($url, $GLOBALS['CANONICAL_RELATIVE_PATH_STUDIP']) === 0;
}