From d52f33a50cde0be5c5dbbac4f120d55f0187c624 Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Sat, 11 Nov 2023 21:38:24 +0100 Subject: [PATCH] adjust spf-entry-regex; check for valid spf-entry in updater; set version to 2.1.0-rc2 Signed-off-by: Michael Kaufmann --- actions/admin/settings/185.spf.php | 2 +- install/froxlor.sql.php | 6 +++--- install/updates/froxlor/update_2.1.inc.php | 15 +++++++++++++++ lib/Froxlor/Froxlor.php | 2 +- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/actions/admin/settings/185.spf.php b/actions/admin/settings/185.spf.php index f4064177d7..5e25711628 100644 --- a/actions/admin/settings/185.spf.php +++ b/actions/admin/settings/185.spf.php @@ -43,7 +43,7 @@ 'settinggroup' => 'spf', 'varname' => 'spf_entry', 'type' => 'text', - 'string_regexp' => '/^v=spf[a-z0-9:~?\s\.-]+$/i', + 'string_regexp' => '/^v=spf[a-z0-9:~?\s.-]+$/i', 'default' => 'v=spf1 a mx -all', 'save_method' => 'storeSettingField' ] diff --git a/install/froxlor.sql.php b/install/froxlor.sql.php index c78b592d15..9e90ee5b76 100644 --- a/install/froxlor.sql.php +++ b/install/froxlor.sql.php @@ -391,7 +391,7 @@ ('admin', 'show_version_footer', '0'), ('caa', 'caa_entry', ''), ('spf', 'use_spf', '0'), - ('spf', 'spf_entry', '"v=spf1 a mx -all"'), + ('spf', 'spf_entry', 'v=spf1 a mx -all'), ('dkim', 'dkim_algorithm', 'all'), ('dkim', 'dkim_keylength', '1024'), ('dkim', 'dkim_servicetype', '0'), @@ -679,7 +679,7 @@ ('system', 'distribution', ''), ('system', 'update_channel', 'stable'), ('system', 'updatecheck_data', ''), - ('system', 'update_notify_last', '2.1.0-rc1'), + ('system', 'update_notify_last', '2.1.0-rc2'), ('system', 'traffictool', 'goaccess'), ('system', 'req_limit_per_interval', 60), ('system', 'req_limit_interval', 60), @@ -727,7 +727,7 @@ ('panel', 'logo_overridecustom', '0'), ('panel', 'settings_mode', '0'), ('panel', 'menu_collapsed', '1'), - ('panel', 'version', '2.1.0-rc1'), + ('panel', 'version', '2.1.0-rc2'), ('panel', 'db_version', '202305240'); diff --git a/install/updates/froxlor/update_2.1.inc.php b/install/updates/froxlor/update_2.1.inc.php index 46599c89ea..3b9918e771 100644 --- a/install/updates/froxlor/update_2.1.inc.php +++ b/install/updates/froxlor/update_2.1.inc.php @@ -108,3 +108,18 @@ Update::showUpdateStep("Updating from 2.1.0-beta2 to 2.1.0-rc1", false); Froxlor::updateToVersion('2.1.0-rc1'); } + +if (Froxlor::isFroxlorVersion('2.1.0-rc1')) { + Update::showUpdateStep("Updating from 2.1.0-rc1 to 2.1.0-rc2", false); + + Update::showUpdateStep("Adjusting setting spf_entry"); + $spf_entry = Settings::Get('spf.spf_entry'); + if (!preg_match('/^v=spf[a-z0-9:~?\s.-]+$/i', $spf_entry)) { + Settings::Set('spf.spf_entry', 'v=spf1 a mx -all'); + Update::lastStepStatus(1, 'corrected'); + } else { + Update::lastStepStatus(0); + } + + Froxlor::updateToVersion('2.1.0-rc2'); +} diff --git a/lib/Froxlor/Froxlor.php b/lib/Froxlor/Froxlor.php index 498f6f7f88..7bec67395c 100644 --- a/lib/Froxlor/Froxlor.php +++ b/lib/Froxlor/Froxlor.php @@ -31,7 +31,7 @@ final class Froxlor { // Main version variable - const VERSION = '2.1.0-rc1'; + const VERSION = '2.1.0-rc2'; // Database version (YYYYMMDDC where C is a daily counter) const DBVERSION = '202305240';