From b1cc4ba35b1cb02444560a6a87fce3fcbc83df29 Mon Sep 17 00:00:00 2001 From: Elmar Ludwig Date: Mon, 5 Sep 2022 13:19:33 +0000 Subject: transfer fixes from #368 to my_studygroups, fixes #1541 Closes #1541 Merge request studip/studip!958 --- app/controllers/institute/overview.php | 22 +++++++++++----------- app/views/my_studygroups/_course.php | 23 ++++++++++++++--------- 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/app/controllers/institute/overview.php b/app/controllers/institute/overview.php index 38cf381..99a59ca 100644 --- a/app/controllers/institute/overview.php +++ b/app/controllers/institute/overview.php @@ -42,17 +42,6 @@ class Institute_OverviewController extends AuthenticatedController object_set_visit($this->institute_id, 0); } - //gibt es eine Anweisung zur Umleitung? - if (Request::get('redirect_to')) { - $query_parts = explode('&', mb_stristr(urldecode($_SERVER['QUERY_STRING']), 'redirect_to')); - list( , $where_to) = explode('=', array_shift($query_parts)); - $new_query = $where_to . '?' . join('&', $query_parts); - page_close(); - $new_query = preg_replace('/[^:0-9a-z+_.#?&=\/-]/i', '', $new_query); - header('Location: '.URLHelper::getURL($new_query, ['cid' => $this->institute_id])); - die; - } - PageLayout::setHelpKeyword("Basis.Einrichtungen"); PageLayout::setTitle($this->institute->getFullName() . " - " ._("Kurzinfo")); Navigation::activateItem('/course/main/info'); @@ -66,6 +55,17 @@ class Institute_OverviewController extends AuthenticatedController */ function index_action() { + //gibt es eine Anweisung zur Umleitung? + $redirect_to = Request::get('redirect_to'); + if ($redirect_to) { + if (!is_internal_url($redirect_to)) { + throw new Exception('Invalid redirection'); + } + + $this->redirect(URLHelper::getURL($redirect_to, ['cid' => $this->institute_id])); + return; + } + $this->sidebar = Sidebar::get(); if (Config::get()->NEWS_RSS_EXPORT_ENABLE && $this->institute_id){ diff --git a/app/views/my_studygroups/_course.php b/app/views/my_studygroups/_course.php index fcdae82..52e3b32 100644 --- a/app/views/my_studygroups/_course.php +++ b/app/views/my_studygroups/_course.php @@ -22,21 +22,26 @@ - + + -- cgit v1.0