aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Hackl <hackl@data-quest.de>2025-08-05 14:08:17 +0200
committerThomas Hackl <hackl@data-quest.de>2025-08-05 14:09:16 +0200
commit541d5b11f9e450b73279fba46daa36a425483ccb (patch)
tree6b333db9fe953595695fdef542ca6b28d68d09be
parent706e2e7f9ece6ac166f1fc57cbb933a1538fd395 (diff)
Resolve BIEST 5764
Closes #5764 Merge request studip/studip!4404
-rw-r--r--lib/functions.php4
-rw-r--r--lib/visual.inc.php4
2 files changed, 8 insertions, 0 deletions
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) {