summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2015-01-21 10:29:08 +0100
committerAleksander Machniak <alec@alec.pl>2015-01-21 10:31:36 +0100
commit2109fc94fb310f24d89ff3738225099936d942cc (patch)
tree4333cb47a2a5935ec56c300e6697e729742462fe
parent7c26dbd36fdfa4f2f70d878d420ee59ad5c2aaac (diff)
Fix bug where empty fieldmap config entries caused empty results of ldap search (#1490229)
Conflicts: CHANGELOG
-rw-r--r--CHANGELOG1
-rw-r--r--program/lib/Roundcube/rcube_ldap.php3
2 files changed, 3 insertions, 1 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 24e97dc3e..31303e0c7 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -10,6 +10,7 @@ CHANGELOG Roundcube Webmail
- Fix so "set as default" option is hidden if identities_level > 1 (#1490226)
- Fix bug where search was reset after returning from compose visited for reply
- Fix javascript error in "IE 8.0/Tablet PC" browser (#1490210)
+- Fix bug where empty fieldmap config entries caused empty results of ldap search (#1490229)
RELEASE 1.0.4
-------------
diff --git a/program/lib/Roundcube/rcube_ldap.php b/program/lib/Roundcube/rcube_ldap.php
index b3872e26b..1f12cae65 100644
--- a/program/lib/Roundcube/rcube_ldap.php
+++ b/program/lib/Roundcube/rcube_ldap.php
@@ -116,13 +116,14 @@ class rcube_ldap extends rcube_addressbook
// fieldmap property is given
if (is_array($p['fieldmap'])) {
+ $p['fieldmap'] = array_filter($p['fieldmap']);
foreach ($p['fieldmap'] as $rf => $lf)
$this->fieldmap[$rf] = $this->_attr_name(strtolower($lf));
}
else if (!empty($p)) {
// read deprecated *_field properties to remain backwards compatible
foreach ($p as $prop => $value)
- if (preg_match('/^(.+)_field$/', $prop, $matches))
+ if (!empty($value) && preg_match('/^(.+)_field$/', $prop, $matches))
$this->fieldmap[$matches[1]] = $this->_attr_name(strtolower($value));
}