diff --git a/ident_switch.php b/ident_switch.php index 7d7ed4f..2a83369 100644 --- a/ident_switch.php +++ b/ident_switch.php @@ -69,7 +69,7 @@ class ident_switch extends rcube_plugin { $defaultKey = $type . '_mbox_default' . self::MY_POSTFIX; $otherKey = $type . '_mbox' . self::MY_POSTFIX; - $val = $_SESSION[$otherKey] ? $_SESSION[$otherKey] : $_SESSION[$defaultKey]; + $val = isset($_SESSION[$otherKey]) ? $_SESSION[$otherKey] : $_SESSION[$defaultKey]; $rc->config->set($type . '_mbox', $val); } @@ -107,7 +107,7 @@ class ident_switch extends rcube_plugin elseif (ctype_digit($iid_s)) $iid = intval($iid_s); - $accNames = array($_SESSION['global_alias'] ? $_SESSION['global_alias'] : $rc->user->data['username']); + $accNames = array(isset($_SESSION['global_alias']) ? $_SESSION['global_alias'] : $rc->user->data['username']); $accValues = array(-1); $accSelected = -1; @@ -665,7 +665,7 @@ class ident_switch extends rcube_plugin foreach (rcube_storage::$folder_types as $type) { $otherKey = $type . '_mbox' . self::MY_POSTFIX; - if ($_SESSION[$otherKey]) + if (isset($_SESSION[$otherKey])) $rc->session->remove($otherKey); } } @@ -693,7 +693,7 @@ class ident_switch extends rcube_plugin { if (strncasecmp($k, 'storage', 7) === 0 && substr_compare($k, self::MY_POSTFIX, -$my_postfix_len, $my_postfix_len) !== 0) { - if (!$_SESSION[$k . self::MY_POSTFIX]) + if (!isset($_SESSION[$k . self::MY_POSTFIX])) $_SESSION[$k . self::MY_POSTFIX] = $_SESSION[$k]; $rc->session->remove($k); @@ -703,7 +703,7 @@ class ident_switch extends rcube_plugin $moreToSave = array('password', 'imap_delimiter'); foreach ($moreToSave as $k) { - if (!$_SESSION[$k . self::MY_POSTFIX]) + if (!isset($_SESSION[$k . self::MY_POSTFIX])) $_SESSION[$k . self::MY_POSTFIX] = $_SESSION[$k]; $rc->session->remove($k); @@ -724,7 +724,7 @@ class ident_switch extends rcube_plugin if ($ssl && strncasecmp($host, $hostProtocol, strlen($hostProtocol)) !== 0) $host = $hostProtocol . $host; - $delimiter = $r['imap_delimiter'] ? $r['imap_delimiter'] : '.'; // Default delimiter here + $delimiter = isset($r['imap_delimiter']) ? $r['imap_delimiter'] : '.'; // Default delimiter here $_SESSION['storage_host'] = $host; $_SESSION['storage_ssl'] = $ssl; @@ -736,7 +736,7 @@ class ident_switch extends rcube_plugin foreach (rcube_storage::$folder_types as $type) { - if ($r[$type . '_mbox']) { + if (isset($r[$type . '_mbox'])) { $otherKey = $type . '_mbox' . self::MY_POSTFIX; $_SESSION[$otherKey] = $r[$type . '_mbox']; }