From 36433a381bb401686681c50fb235cd2d106662b1 Mon Sep 17 00:00:00 2001 From: Ron Lucke Date: Tue, 8 Jul 2025 20:28:37 +0200 Subject: =?UTF-8?q?Klick=20auf=20das=20Ank=C3=BCndigungen-Symbol=20kann=20?= =?UTF-8?q?zur=20falschen=20Stelle=20f=C3=BChren?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #5559 Merge request studip/studip!4225 --- app/controllers/institute/overview.php | 11 ++++++++--- lib/classes/MyRealmModel.php | 3 ++- lib/modules/CoreOverview.class.php | 3 ++- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/app/controllers/institute/overview.php b/app/controllers/institute/overview.php index f511bd4..8326fa2 100644 --- a/app/controllers/institute/overview.php +++ b/app/controllers/institute/overview.php @@ -57,13 +57,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 27d5916..e25e6c5 100644 --- a/lib/classes/MyRealmModel.php +++ b/lib/classes/MyRealmModel.php @@ -123,7 +123,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.class.php b/lib/modules/CoreOverview.class.php index 042891a..66d5830 100644 --- a/lib/modules/CoreOverview.class.php +++ b/lib/modules/CoreOverview.class.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), [ -- cgit v1.0