Skip to content
Snippets Groups Projects
Commit 5655e10f authored by David Siegfried's avatar David Siegfried Committed by Jan-Hendrik Willms
Browse files

prevent php-warnings, closes #2286

Closes #2286

Merge request studip/studip!1509
parent 80da8c24
No related branches found
No related tags found
1 merge request!4Draft: Icon creation
......@@ -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);
}
}
......
......@@ -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>
......
......@@ -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">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment