From cb11393661f5cdf9a1ddacb8cd9602de70f5b8f9 Mon Sep 17 00:00:00 2001 From: Jan-Hendrik Willms Date: Thu, 30 May 2024 06:57:51 +0000 Subject: fixes #4221 Closes #4221 Merge request studip/studip!3064 --- app/controllers/admin/user.php | 2 +- app/controllers/course/dates.php | 5 ++++- app/controllers/course/wiki.php | 6 +++--- app/controllers/oer/endpoints.php | 2 +- app/controllers/quicksearch.php | 2 +- app/views/activityfeed/configuration.php | 2 +- app/views/admin/autoinsert/manual.php | 6 +++--- app/views/admin/cronjobs/schedules/index.php | 2 +- app/views/admin/user/edit.php | 4 ++-- app/views/file/choose_destination.php | 2 +- lib/classes/ForumEntry.php | 4 ++-- lib/classes/exportdocument/ExportPDF.class.php | 5 ++++- lib/classes/librarysearch/LibraryDocument.class.php | 4 ++-- lib/phplib/Seminar_Auth.class.php | 2 +- lib/visual.inc.php | 2 +- templates/filesystem/group_folder/edit.php | 2 +- templates/filesystem/topic_folder/edit.php | 2 +- 17 files changed, 30 insertions(+), 24 deletions(-) diff --git a/app/controllers/admin/user.php b/app/controllers/admin/user.php index 1d8361c..37a5d2e 100644 --- a/app/controllers/admin/user.php +++ b/app/controllers/admin/user.php @@ -1719,7 +1719,7 @@ class Admin_UserController extends AuthenticatedController )->asDialog(); $actions->addLink( _('Konten zusammenführen'), - $this->url_for('admin/user/migrate/' . ((!empty($this->user) && is_array($this->user)) ? $this->user['user_id'] : '')), + $this->url_for('admin/user/migrate/' . (!empty($this->user['user_id']) ? $this->user['user_id'] : '')), Icon::create('community') ); diff --git a/app/controllers/course/dates.php b/app/controllers/course/dates.php index a4e18e9..f64d66b 100644 --- a/app/controllers/course/dates.php +++ b/app/controllers/course/dates.php @@ -80,7 +80,10 @@ class Course_DatesController extends AuthenticatedController )->asDialog(); } - if (Seminar::setInstance(new Seminar(Course::findCurrent()))->getSlotModule('documents') && CourseDateFolder::availableInRange(Course::findCurrent(), User::findCurrent()->id)) { + if ( + Seminar::setInstance(new Seminar(Course::findCurrent()))->getSlotModule('documents') + && CourseDateFolder::availableInRange(Course::findCurrent(), User::findCurrent() ? User::findCurrent()->id : null) + ) { $actions->addLink( _('Sitzungsordner anlegen'), $this->url_for('course/dates/create_folders'), diff --git a/app/controllers/course/wiki.php b/app/controllers/course/wiki.php index 0bb6c71..4de56a7 100644 --- a/app/controllers/course/wiki.php +++ b/app/controllers/course/wiki.php @@ -455,7 +455,7 @@ class Course_WikiController extends AuthenticatedController ); $pageData = [ 'page_id' => $page->id, - 'user_id' => $user->id + 'user_id' => $user ? $user->id : null, ]; $online_user = WikiOnlineEditingUser::findOneBySQL( '`page_id` = :page_id AND `user_id` = :user_id', @@ -466,7 +466,7 @@ class Course_WikiController extends AuthenticatedController } $editingUsers = WikiOnlineEditingUser::countBySQL( "`page_id` = ? AND `editing` = 1 AND `user_id` != ?", - [$page->id, $user->id] + [$page->id, $user ? $user->id : null] ); $online_user->editing = $editingUsers === 0 ? 1 : 0; $online_user->chdate = time(); @@ -635,7 +635,7 @@ class Course_WikiController extends AuthenticatedController $statement->execute([ 'range_id' => $this->range->id, 'threshold' => $this->last_visit, - 'me' => User::findCurrent()->id + 'me' => User::findCurrent() ? User::findCurrent()->id : null ]); $this->num_entries = $statement->fetch(PDO::FETCH_COLUMN); $this->pagenumber = Request::int('page', 0); diff --git a/app/controllers/oer/endpoints.php b/app/controllers/oer/endpoints.php index 9a0f3f5..1ce9626 100644 --- a/app/controllers/oer/endpoints.php +++ b/app/controllers/oer/endpoints.php @@ -374,7 +374,7 @@ class Oer_EndpointsController extends StudipController header("Expires: Mon, 12 Dec 2001 08:00:00 GMT"); header("Last-Modified: " . gmdate ("D, d M Y H:i:s") . " GMT"); - if ($_SERVER['HTTPS'] == "on") { + if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on') { header("Pragma: public"); header("Cache-Control: private"); } else { diff --git a/app/controllers/quicksearch.php b/app/controllers/quicksearch.php index 194f317..9c6a4ae 100644 --- a/app/controllers/quicksearch.php +++ b/app/controllers/quicksearch.php @@ -94,7 +94,7 @@ class QuicksearchController extends AuthenticatedController if (!empty($result[3])) { $formatted['item_description'] = sprintf('%s (%s)', $result[2], $result[3]); } else { - $formatted['item_description'] = $result[2]; + $formatted['item_description'] = $result[2] ?? ''; } } else if ($this->search instanceof SearchType) { $formatted['item_name'] = $this->search->getAvatarImageTag($result[0], Avatar::SMALL, ['title' => '']) . $formatted['item_name']; diff --git a/app/views/activityfeed/configuration.php b/app/views/activityfeed/configuration.php index ceb87eb..9161db0 100644 --- a/app/views/activityfeed/configuration.php +++ b/app/views/activityfeed/configuration.php @@ -15,7 +15,7 @@ $prv_name) : ?> diff --git a/app/views/admin/autoinsert/manual.php b/app/views/admin/autoinsert/manual.php index dd0f834..a4f5f5e 100644 --- a/app/views/admin/autoinsert/manual.php +++ b/app/views/admin/autoinsert/manual.php @@ -114,14 +114,14 @@ $value): ?> + class="nested-item-header" > $v): ?> + class="nested-item" > + value="" > diff --git a/app/views/admin/cronjobs/schedules/index.php b/app/views/admin/cronjobs/schedules/index.php index f4b0b13..79a65be 100644 --- a/app/views/admin/cronjobs/schedules/index.php +++ b/app/views/admin/cronjobs/schedules/index.php @@ -23,7 +23,7 @@ use Studip\Button, Studip\LinkButton;