Skip to content

Commit

Permalink
Fix PHP warnings (#9174)
Browse files Browse the repository at this point in the history
  • Loading branch information
alecpl committed Oct 20, 2023
1 parent 7fe57f2 commit 618513a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- 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

Expand Down
10 changes: 6 additions & 4 deletions plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down Expand Up @@ -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');
Expand All @@ -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)) {
Expand Down Expand Up @@ -2776,6 +2776,8 @@ protected function strip_value($str, $allow_html = false, $trim = true)
return $str;
}

$str = (string) $str;

if (!$allow_html) {
$str = strip_tags($str);
}
Expand Down

0 comments on commit 618513a

Please sign in to comment.