diff options
| author | Ron Lucke <lucke@elan-ev.de> | 2025-07-08 20:28:37 +0200 |
|---|---|---|
| committer | Ron Lucke <lucke@elan-ev.de> | 2025-07-08 20:28:37 +0200 |
| commit | a02371a023bc06bab62d774a3a38fd242aed0f99 (patch) | |
| tree | a9ae2280f960f9a92cf0c5526b975ce06eb3c690 | |
| parent | 1d36a075b509d9deca999ac175036677c8447bcc (diff) | |
Klick auf das Ankündigungen-Symbol kann zur falschen Stelle führen
Closes #5559
Merge request studip/studip!4225
| -rw-r--r-- | app/controllers/institute/overview.php | 11 | ||||
| -rw-r--r-- | lib/classes/MyRealmModel.php | 3 | ||||
| -rw-r--r-- | lib/modules/CoreOverview.php | 3 |
3 files changed, 12 insertions, 5 deletions
diff --git a/app/controllers/institute/overview.php b/app/controllers/institute/overview.php index db83115..603e632 100644 --- a/app/controllers/institute/overview.php +++ b/app/controllers/institute/overview.php @@ -60,13 +60,18 @@ class Institute_OverviewController 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'); } - $this->response->add_header('Location', URLHelper::getURL($redirect_to, ['cid' => $this->institute_id])); - $this->render_nothing(); + $this->redirect(URLHelper::getURL($redirect_to, ['cid' => $this->institute_id])); return; } diff --git a/lib/classes/MyRealmModel.php b/lib/classes/MyRealmModel.php index 3b6085c..283ff75 100644 --- a/lib/classes/MyRealmModel.php +++ b/lib/classes/MyRealmModel.php @@ -93,7 +93,8 @@ class MyRealmModel } if ($neue || $count > 0) { - $nav = new Navigation('vote', 'dispatch.php/course/overview'); + $base_url = $my_obj['obj_type'] === 'sem' ? 'course' : 'institute'; + $nav = new Navigation('vote', "dispatch.php/$base_url/overview"); if ($neue) { $nav->setImage(Icon::create('vote', Icon::ROLE_ATTENTION, [ 'title' => sprintf( diff --git a/lib/modules/CoreOverview.php b/lib/modules/CoreOverview.php index b1a14df..7a73be7 100644 --- a/lib/modules/CoreOverview.php +++ b/lib/modules/CoreOverview.php @@ -40,7 +40,8 @@ class CoreOverview extends CorePlugin implements StudipModule return null; } - $nav = new Navigation(_('Ankündigungen'), 'dispatch.php/course/overview'); + $base_url = get_object_type($course_id, ['sem']) ? 'course' : 'institute'; + $nav = new Navigation('Ankündigungen', "dispatch.php/$base_url/overview"); if ($result['neue']) { $nav->setURL('?new_news=true'); $nav->setImage(Icon::create('news', Icon::ROLE_ATTENTION, [ |
