diff options
| author | Ron Lucke <lucke@elan-ev.de> | 2025-07-08 20:28:37 +0200 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2025-07-11 10:00:58 +0200 |
| commit | 36433a381bb401686681c50fb235cd2d106662b1 (patch) | |
| tree | 23638e297ebae6e6754036d3a2021841131f56c4 | |
| parent | 46d928098633c82ccb5a4defeac1267d3df510de (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.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), [ |
