diff --git a/app/controllers/files.php b/app/controllers/files.php
index 9ed804f5ae57ef61e08b9b8cbb503b2061586f80..80802e5085eb68b765ce5fa128ebf031fa402951 100644
--- a/app/controllers/files.php
+++ b/app/controllers/files.php
@@ -334,7 +334,6 @@ class FilesController extends AuthenticatedController
 
         $course_did_change = false;
         if ($this->current_view != 'overview') {
-            $tzdt = new DateTime();
             if (Request::submitted('filter')) {
                 CSRFProtection::verifyUnsafeRequest();
                 if (Request::get('begin') && Request::get('end')) {
@@ -365,9 +364,9 @@ class FilesController extends AuthenticatedController
                     $_SESSION['files_overview']['course_id'] = $this->course_id;
                 }
             } else {
-                $this->begin = $_SESSION['files_overview']['begin'];
-                $this->end = $_SESSION['files_overview']['end'];
-                $this->course_id = $_SESSION['files_overview']['course_id'];
+                $this->begin = $_SESSION['files_overview']['begin'] ?? null;
+                $this->end = $_SESSION['files_overview']['end'] ?? null;
+                $this->course_id = $_SESSION['files_overview']['course_id'] ?? null;
             }
         }
 
@@ -700,7 +699,7 @@ class FilesController extends AuthenticatedController
         $copymode   = Request::get('copymode');
 
         $user = User::findCurrent();
-
+        $destination_plugin = null;
         if ($to_plugin) {
 
             $destination_id = substr($_SERVER['REQUEST_URI'], strpos($_SERVER['REQUEST_URI'], "dispatch.php/files/copyhandler/") + strlen("dispatch.php/files/copyhandler/"));
@@ -721,7 +720,7 @@ class FilesController extends AuthenticatedController
 
         $count_files   = 0;
         $count_folders = 0;
-
+        $source_folder = null;
         $filerefs = $fileref_id;
         if (!empty($filerefs)) {
 
@@ -784,7 +783,7 @@ class FilesController extends AuthenticatedController
                         }
                     }
                 }
-                if (is_array($result)) {
+                if (isset($result) && is_array($result)) {
                     $errors = array_merge($errors, $result);
                 }
             }
diff --git a/app/views/files/flat.php b/app/views/files/flat.php
index 7b68e0226397af6577ba9f9ecd35993d84ee5adc..a7d0c93fc900f1ad8c4e8a17b21680d74af78915 100644
--- a/app/views/files/flat.php
+++ b/app/views/files/flat.php
@@ -45,7 +45,7 @@ foreach ($topFolder->getAdditionalActionButtons() as $button) {
 ?>
 <form id="files_table_form"
       method="post"
-      action="<?= htmlReady($form_action) ?>"
+      action="<?= htmlReady($form_action ?? '') ?>"
       data-files="<?= htmlReady(json_encode($vue_files)) ?>"
       data-topfolder="<?= htmlReady(json_encode((array) $vue_topFolder)) ?>">
     <?= CSRFProtection::tokenTag() ?>
@@ -55,8 +55,8 @@ foreach ($topFolder->getAdditionalActionButtons() as $button) {
                  :folders="folders"
                  :topfolder="topfolder"
                  :allow_filter="<?= json_encode(!empty($enable_table_filter)) ?>"
-                 table_title="<?= htmlReady($table_title) ?>"
-                 pagination="<?= htmlReady($pagination_html) ?>"
+                 table_title="<?= htmlReady($table_title ?? '') ?>"
+                 pagination="<?= htmlReady($pagination_html ?? '') ?>"
                  :initial_sort="{sortedBy:'chdate',sortDirection:'desc'}"
     ></files-table>
 </form>
diff --git a/templates/sidebar/time-range-filter.php b/templates/sidebar/time-range-filter.php
index 793381e4ecf20376a1b714008edfeaf41e1f2142..97dbcf678208c656209843adee13664d47fc97a1 100644
--- a/templates/sidebar/time-range-filter.php
+++ b/templates/sidebar/time-range-filter.php
@@ -2,15 +2,15 @@
     <?= CSRFProtection::tokenTag() ?>
     <label>
         <?= _('Dateien neuer als') ?>:
-        <input type="text" name="begin" value="<?= htmlReady($begin) ?>"
+        <input type="text" name="begin" value="<?= htmlReady($begin ?? '') ?>"
                class="hasDatePicker">
     </label>
     <label>
         <?= _('Dateien älter als') ?>:
-        <input type="text" name="end" value="<?= htmlReady($end) ?>"
+        <input type="text" name="end" value="<?= htmlReady($end ?? '') ?>"
                class="hasDatePicker submit-on-change">
     </label>
-    <? if ($course_options) : ?>
+    <? if (!empty($course_options)) : ?>
         <label>
             <?= _('Veranstaltung') ?>:
             <select name="course_id">