From 76db10d65d6c21062c39ae867ab6d34f33aca537 Mon Sep 17 00:00:00 2001 From: alecpl Date: Fri, 24 Apr 2009 12:54:25 +0000 Subject: [PATCH] - fix setting empty string in imap_root --- program/include/main.inc | 5 +++-- program/include/rcmail.php | 8 ++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/program/include/main.inc b/program/include/main.inc index 1149429ff..80b9e61b7 100644 --- a/program/include/main.inc +++ b/program/include/main.inc @@ -829,12 +829,13 @@ function format_email_recipient($email, $name='') function console() { $args = func_get_args(); + if (class_exists('rcmail', false)) - rcmail::get_instance()->plugins->exec_hook('console', $args); + rcmail::get_instance()->plugins->exec_hook('console', $args); $msg = array(); foreach ($args as $arg) - $msg[] = !is_string($arg) ? var_export($arg, true) : $arg; + $msg[] = !is_string($arg) ? var_export($arg, true) : $arg; if (!($GLOBALS['CONFIG']['debug_level'] & 4)) write_log('console', join(";\n", $msg)); diff --git a/program/include/rcmail.php b/program/include/rcmail.php index 56fc2f5db..603ac335a 100644 --- a/program/include/rcmail.php +++ b/program/include/rcmail.php @@ -371,13 +371,9 @@ class rcmail $options = array( 'imap' => $this->config->get('imap_auth_type', 'check'), 'delimiter' => isset($_SESSION['imap_delimiter']) ? $_SESSION['imap_delimiter'] : $this->config->get('imap_delimiter'), + 'rootdir' => isset($_SESSION['imap_root']) ? $_SESSION['imap_root'] : $this->config->get('imap_root'), ); - - if (isset($_SESSION['imap_root'])) - $options['rootdir'] = $_SESSION['imap_root']; - else if ($imap_root = $this->config->get('imap_root')) - $options['rootdir'] = $imap_root; - + $this->imap->set_options($options); // set global object for backward compatibility