From 541d5b11f9e450b73279fba46daa36a425483ccb Mon Sep 17 00:00:00 2001 From: Thomas Hackl Date: Tue, 5 Aug 2025 14:08:17 +0200 Subject: Resolve BIEST 5764 Closes #5764 Merge request studip/studip!4404 --- lib/functions.php | 4 ++++ lib/visual.inc.php | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/lib/functions.php b/lib/functions.php index f08ab88..a6bad21 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -1188,6 +1188,10 @@ function get_title_for_status($type, $count, $sem_type = NULL) */ function is_internal_url($url) { + if (mb_substr($url, 0, 2) === '//') { + $url = Request::protocol() . ':' . $url; + } + if (preg_match('%^[a-z]+:%', $url)) { return mb_strpos($url, $GLOBALS['ABSOLUTE_URI_STUDIP']) === 0; } diff --git a/lib/visual.inc.php b/lib/visual.inc.php index f070752..4b3f321 100644 --- a/lib/visual.inc.php +++ b/lib/visual.inc.php @@ -283,6 +283,10 @@ function isURL($url) { } function isLinkIntern($url) { + if (mb_substr($url, 0, 2) === '//') { + $url = Request::protocol() . ':' . $url; + } + $pum = @parse_url(TransformInternalLinks($url)); if (!$pum) { -- cgit v1.0