aboutsummaryrefslogtreecommitdiff
path: root/app/controllers/course/go.php
diff options
context:
space:
mode:
authorAndré Noack <noack@data-quest.de>2025-01-06 12:43:28 +0000
committerAndré Noack <noack@data-quest.de>2025-01-06 12:43:28 +0000
commitd43d4b7b3455b9c282202348b2235908fcd96c5e (patch)
tree12dc6b88202a669340131de820680a77914b1cb5 /app/controllers/course/go.php
parent5f7f126ca49236d5d3805366df2445cb70e2a2bc (diff)
Resolve #5096 "Klick auf neue Ankündigung führt zu Exception: Default controller 'default' not found'"
Closes #5096 Merge request studip/studip!3809
Diffstat (limited to 'app/controllers/course/go.php')
-rw-r--r--app/controllers/course/go.php13
1 files changed, 8 insertions, 5 deletions
diff --git a/app/controllers/course/go.php b/app/controllers/course/go.php
index 400c44a..8356913 100644
--- a/app/controllers/course/go.php
+++ b/app/controllers/course/go.php
@@ -46,13 +46,16 @@ class Course_GoController extends AuthenticatedController
// gibt es eine Anweisung zur Umleitung?
$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)) {
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]));
return;
}
@@ -62,7 +65,7 @@ class Course_GoController extends AuthenticatedController
if (Navigation::hasItem("/course")) {
foreach (Navigation::getItem("/course")->getSubNavigation() as $index => $navigation) {
if ($index !== 'admin') {
- $this->redirect(URLHelper::getURL($navigation->getURL()));
+ $this->redirect(URLHelper::getURL($navigation->getURL() . $redirect_to));
return;
}
}