From fa9eda18b81fe3cb7f1d85c10c2c221e917a0b45 Mon Sep 17 00:00:00 2001 From: nathangray Date: Tue, 12 May 2020 09:30:55 -0600 Subject: [PATCH] Setup: Fix backups to keep of 0 gave an error "must be integer" --- setup/db_backup.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup/db_backup.php b/setup/db_backup.php index 291530e38f..8486f4c883 100644 --- a/setup/db_backup.php +++ b/setup/db_backup.php @@ -87,10 +87,10 @@ else if ($_POST['save_backup_settings']) { $matches = array(); - preg_match('/^[1-9][0-9]*$/', $_POST['backup_mincount'], $matches); - $minCount = $matches[0]; + preg_match('/^\d*$/', $_POST['backup_mincount'], $matches); + $minCount = (int)$matches[0]; $filesBackup = $_POST['backup_files'] === 'backup_files'; - if (empty($minCount)) + if (empty($minCount) && $matches[0] != '0') { $minCount = 0; $setup_tpl->set_var('error_msg',htmlspecialchars(lang("'%1' must be integer", lang("backup min count"))));