Skip to content
Snippets Groups Projects
Commit d43d4b7b authored by André Noack's avatar André Noack
Browse files

Resolve #5096 "Klick auf neue Ankündigung führt zu Exception: Default...

Resolve #5096 "Klick auf neue Ankündigung führt zu Exception: Default controller 'default' not found'"

Closes #5096

Merge request !3809
parent 5f7f126c
No related branches found
No related tags found
No related merge requests found
...@@ -46,13 +46,16 @@ class Course_GoController extends AuthenticatedController ...@@ -46,13 +46,16 @@ class Course_GoController extends AuthenticatedController
// gibt es eine Anweisung zur Umleitung? // gibt es eine Anweisung zur Umleitung?
$redirect_to = Request::get('redirect_to'); $redirect_to = Request::get('redirect_to');
if ($redirect_to) { if (
$redirect_to
&& !(
str_starts_with($redirect_to, '#')
|| str_starts_with($redirect_to, '?')
)
) {
if (!is_internal_url($redirect_to)) { if (!is_internal_url($redirect_to)) {
throw new Exception('Invalid redirection'); throw new Exception('Invalid redirection');
} }
if (str_starts_with($redirect_to, '#')) {
$redirect_to = 'dispatch.php/course/go' . $redirect_to;
}
$this->redirect(URLHelper::getURL($redirect_to, ['cid' => $course_id])); $this->redirect(URLHelper::getURL($redirect_to, ['cid' => $course_id]));
return; return;
} }
...@@ -62,7 +65,7 @@ class Course_GoController extends AuthenticatedController ...@@ -62,7 +65,7 @@ class Course_GoController extends AuthenticatedController
if (Navigation::hasItem("/course")) { if (Navigation::hasItem("/course")) {
foreach (Navigation::getItem("/course")->getSubNavigation() as $index => $navigation) { foreach (Navigation::getItem("/course")->getSubNavigation() as $index => $navigation) {
if ($index !== 'admin') { if ($index !== 'admin') {
$this->redirect(URLHelper::getURL($navigation->getURL())); $this->redirect(URLHelper::getURL($navigation->getURL() . $redirect_to));
return; return;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment