diff --git a/CHANGELOG.md b/CHANGELOG.md index 91c8827a7e1..640f5bdfcd5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ - Fix potential HTTP protocol version mismatch (#8982) - Fix PHP8 fatal error when parsing a malformed BODYSTRUCTURE (#9171) - Fix duplicated Inbox folder on IMAP servers that do not use Inbox folder with all capital letters (#9166) +- Fix PHP warnings (#9174) ## Release 1.6.4 diff --git a/plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php b/plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php index 0138343f4a7..7e77a2bbc74 100644 --- a/plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php +++ b/plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php @@ -727,7 +727,7 @@ function save() $this->form['tests'][$i]['type'] = $sizeop; $this->form['tests'][$i]['arg'] = $sizetarget; - if ($sizetarget == '') { + if ($sizetarget === '') { $this->errors['tests'][$i]['sizetarget'] = $this->plugin->gettext('cannotbeempty'); } else if (!preg_match('/^[0-9]+(K|M|G)?$/i', $sizetarget.$sizeitem, $m)) { @@ -1067,8 +1067,8 @@ function save() case 'redirect': case 'redirect_copy': - $target = $this->strip_value(isset($act_targets[$idx]) ? $act_targets[$idx] : null); - $domain = $this->strip_value(isset($domain_targets[$idx]) ? $domain_targets[$idx] : null); + $target = $this->strip_value($act_targets[$idx] ?? null); + $domain = $this->strip_value($domain_targets[$idx] ?? null); // force one of the configured domains $domains = (array) $this->rc->config->get('managesieve_domains'); @@ -1082,7 +1082,7 @@ function save() $this->form['actions'][$i]['target'] = $target; - if ($target == '') { + if ($target === '') { $this->errors['actions'][$i]['target'] = $this->plugin->gettext('cannotbeempty'); } else if (!rcube_utils::check_email($target)) { @@ -2780,6 +2780,8 @@ protected function strip_value($str, $allow_html = false, $trim = true) return $str; } + $str = (string) $str; + if (!$allow_html) { $str = strip_tags($str); }