Skip to content
Snippets Groups Projects
Commit 33480103 authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

simplify and fix linking

parent 55966778
No related branches found
No related tags found
No related merge requests found
......@@ -62,17 +62,13 @@ if (Request::get('auswahl')) {
// gibt es eine Anweisung zur Umleitung?
if (Request::get('redirect_to')) {
$query_parts = explode('&', mb_stristr(urldecode($_SERVER['QUERY_STRING']), 'redirect_to'));
list( , $where_to) = explode('=', array_shift($query_parts));
$new_query = $where_to . '?' . join('&', $query_parts);
$new_query = preg_replace('/[^:0-9a-z+_.#?&=\/-]/i', '', $new_query);
if (preg_match('~^(\w+:)?//~', $new_query) && !is_internal_url($new_query)) {
$redirect_to = Request::get('redirect_to');
if ($redirect_to) {
if (!is_internal_url($redirect_to)) {
throw new Exception('Invalid redirection');
}
header('Location: '.URLHelper::getURL($new_query, ['cid' => $course_id]));
header('Location: '.URLHelper::getURL($redirect_to, ['cid' => $course_id]));
die;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment