aboutsummaryrefslogtreecommitdiff
path: root/lib
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:08:17 +0200
commit5b794550b4fa0bc892d924088466bf0065ecf2d7 (patch)
treeb8817c0ab0dceab5331f00aab023936fa1d482aa /lib
parent66d91e7b81f978ae4d3b9254334427938599dee6 (diff)
Resolve BIEST 5764
Closes #5764 Merge request studip/studip!4404
Diffstat (limited to 'lib')
-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 3198cb1..ff71ea9 100644
--- a/lib/functions.php
+++ b/lib/functions.php
@@ -815,6 +815,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 b400ca9..67c8c31 100644
--- a/lib/visual.inc.php
+++ b/lib/visual.inc.php
@@ -272,6 +272,10 @@ function isURL($url) {
}
function isLinkIntern($url) {
+ if (mb_substr($url, 0, 2) === '//') {
+ $url = Request::protocol() . ':' . $url;
+ }
+
$pum = @parse_url(TransformInternalLinks($url));
if (!$pum) {