From bf99c50cc18d3bf35f85f5b3b09293f27605b1d2 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Wed, 21 Jan 2015 10:29:08 +0100 Subject: Fix bug where empty fieldmap config entries caused empty results of ldap search (#1490229) --- CHANGELOG | 1 + program/lib/Roundcube/rcube_ldap.php | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 10e520700..d98b4a468 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -12,6 +12,7 @@ CHANGELOG Roundcube Webmail - 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 Reply-To address was ignored on reply to messages sent by self (#1490233) +- Fix bug where empty fieldmap config entries caused empty results of ldap search (#1490229) RELEASE 1.1-rc -------------- diff --git a/program/lib/Roundcube/rcube_ldap.php b/program/lib/Roundcube/rcube_ldap.php index 981f2e841..13d55bde6 100644 --- a/program/lib/Roundcube/rcube_ldap.php +++ b/program/lib/Roundcube/rcube_ldap.php @@ -117,13 +117,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)); } -- cgit v1.2.3