Skip to content

Commit

Permalink
Fixed undefined variable when no IMAP auth
Browse files Browse the repository at this point in the history
  • Loading branch information
josaphatim committed Jul 2, 2024
1 parent 1284c47 commit eac34f6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions modules/imap/handler_modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -1564,12 +1564,12 @@ public function process() {
if (! empty($auth_server['sieve_config_host'])) {
$imap_details['sieve_config_host'] = $auth_server['sieve_config_host'];
}
}
if (!$default_server_id) {
Hm_IMAP_List::add($imap_details);
} else {
// Perhaps something as changed
Hm_IMAP_List::edit($default_server_id, $imap_details);
if (!$default_server_id) {
Hm_IMAP_List::add($imap_details);
} else {
// Perhaps something as changed
Hm_IMAP_List::edit($default_server_id, $imap_details);
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function test_filter_servers() {
$this->assertEquals(array('imap_servers' => array(array())), $this->config->filter_servers());

$this->config->set('imap_servers', array(array('default' => 1, 'server' => 'localhost')));
$this->assertEquals(array('imap_servers' => array(array('default' => 1, 'server' => 'localhost'))), $this->config->filter_servers());
$this->assertEquals(array(), $this->config->filter_servers());

$this->config->set('imap_servers', array(array('pass' => 'foo', 'server' => 'localhost')));
$this->config->set('no_password_save_setting', true);
Expand Down

0 comments on commit eac34f6

Please sign in to comment.