Fix the duration set error

This commit is contained in:
Gregory Trolliet 2020-11-25 22:35:28 +01:00
parent 3fbeb06948
commit 06de0eb561
2 changed files with 3 additions and 4 deletions

View file

@ -29,7 +29,6 @@ if (empty($_POST)) {
</div>
<?php
} else {
$length = 6;
$token = bin2hex(random_bytes($length));
if (isset($_POST['fsize']) && is_numeric($_POST['fsize'])) {
@ -42,7 +41,7 @@ if (empty($_POST)) {
} else {
$text = '';
}
if (isset($_POST['fduration']) && in_array($_POST['fduration'], DataBase::OPTIONS_DURATION)) {
if (isset($_POST['fduration']) && key_exists($_POST['fduration'], DataBase::OPTIONS_DURATION)) {
$duration = $_POST['fduration'];
} else {
$duration = DataBase::DEFAULT_DURATION;