summaryrefslogtreecommitdiff
path: root/program/include/rcmail.php
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2013-04-29 08:04:15 +0200
committerAleksander Machniak <alec@alec.pl>2013-04-29 08:04:15 +0200
commitd14a2fb8bc11df61d473d4e61822ca70dbea0ee3 (patch)
treeb67d1becd4de5c4b5334cbf8909e859a521df6df /program/include/rcmail.php
parent28151b329bc770c1f2540aa3b5ee668ec71595d9 (diff)
Fix possible warning on some misconfig
Diffstat (limited to 'program/include/rcmail.php')
-rw-r--r--program/include/rcmail.php11
1 files changed, 5 insertions, 6 deletions
diff --git a/program/include/rcmail.php b/program/include/rcmail.php
index 1bde4034f..3f6b39fc7 100644
--- a/program/include/rcmail.php
+++ b/program/include/rcmail.php
@@ -258,13 +258,13 @@ class rcmail extends rcube
*/
public function get_address_sources($writeable = false, $skip_hidden = false)
{
- $abook_type = strtolower($this->config->get('address_book_type'));
- $ldap_config = $this->config->get('ldap_public');
+ $abook_type = (string) $this->config->get('address_book_type');
+ $ldap_config = (array) $this->config->get('ldap_public');
$autocomplete = (array) $this->config->get('autocomplete_addressbooks');
- $list = array();
+ $list = array();
// We are using the DB address book or a plugin address book
- if ($abook_type != 'ldap' && $abook_type != '') {
+ if (!empty($abook_type) && strtolower($abook_type) != 'ldap') {
if (!isset($this->address_books['0']))
$this->address_books['0'] = new rcube_contacts($this->db, $this->get_user_id());
$list['0'] = array(
@@ -277,8 +277,7 @@ class rcmail extends rcube
);
}
- if ($ldap_config) {
- $ldap_config = (array) $ldap_config;
+ if (!empty($ldap_config)) {
foreach ($ldap_config as $id => $prop) {
// handle misconfiguration
if (empty($prop) || !is_array($prop)) {