Skip to content

Commit

Permalink
Managesieve: Fix PHP fatal error when connection fails
Browse files Browse the repository at this point in the history
  • Loading branch information
alecpl committed Jun 30, 2023
1 parent fa492b8 commit cc7e0b2
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php
Expand Up @@ -2952,13 +2952,15 @@ public function list_scripts()

$this->sieve->load($user_script);

foreach ($this->sieve->script->as_array() as $rules) {
foreach ($rules['actions'] as $action) {
if ($action['type'] == 'include' && empty($action['global'])) {
$name = preg_replace($filename_regex, '', $action['target']);
// make sure the script exist
if (in_array($name, $this->list)) {
$this->active[] = $name;
if (!empty($this->sieve->script)) {
foreach ($this->sieve->script->as_array() as $rules) {
foreach ($rules['actions'] as $action) {
if ($action['type'] == 'include' && empty($action['global'])) {
$name = preg_replace($filename_regex, '', $action['target']);
// make sure the script exist
if (in_array($name, $this->list)) {
$this->active[] = $name;
}
}
}
}
Expand Down

0 comments on commit cc7e0b2

Please sign in to comment.