From a4e50e396186f2fc71ffc4a6740d2ad75750433d Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Wed, 25 Sep 2024 11:41:03 +0200 Subject: [PATCH] Managesieve: Fix current script state after initial scripts creation in managesieve_kolab_master mode --- CHANGELOG.md | 1 + plugins/managesieve/Changelog | 1 + plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4008fba2cf..5e7e392b9f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -62,6 +62,7 @@ - Fix potential HTTP protocol version mismatch (#8982) - Fix PHP warnings (#9616, #9611) - Fix whitespace handling in vCard line continuation (#9637) +- Fix current script state after initial scripts creation in managesieve_kolab_master mode ## Release 1.6.9 diff --git a/plugins/managesieve/Changelog b/plugins/managesieve/Changelog index d436dbb00b..990e53984b 100644 --- a/plugins/managesieve/Changelog +++ b/plugins/managesieve/Changelog @@ -3,6 +3,7 @@ - Support an array in managesieve_host option (#9447) - Protect special scripts in managesieve_kolab_master mode - Fix infinite loop when parsing a malformed script (#9562) +- Fix current script state after initial scripts creation in managesieve_kolab_master mode * version 9.5 [2023-03-26] ----------------------------------------------------------- diff --git a/plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php b/plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php index 15b468bac3..31c77d758b 100644 --- a/plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php +++ b/plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php @@ -266,11 +266,11 @@ protected function load_script($script_name = null) // get (first) active script if (!empty($this->active)) { $script_name = $this->active[0]; - } elseif ($list) { + } elseif (!empty($list)) { $script_name = $list[0]; } else { // if script does not exist create one with default content - $this->create_default_script(); + $script_name = $this->create_default_script(); } }