summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2011-10-07 08:33:24 +0000
committeralecpl <alec@alec.pl>2011-10-07 08:33:24 +0000
commitb1f0846727331f58342e9cfdd02df03ea8f15181 (patch)
treeb1669c03a72dab26aa8133371729144f69820489 /program
parent8fb04bee97aa6ae0b4a9faac0a4c0d2d27e1f64e (diff)
- Make sure LDAP name fields aren't arrays (#1488108)
Diffstat (limited to 'program')
-rw-r--r--program/include/rcube_ldap.php9
-rw-r--r--program/steps/mail/search.inc2
2 files changed, 8 insertions, 3 deletions
diff --git a/program/include/rcube_ldap.php b/program/include/rcube_ldap.php
index 55c8c154f..a3f6dc56d 100644
--- a/program/include/rcube_ldap.php
+++ b/program/include/rcube_ldap.php
@@ -72,7 +72,7 @@ class rcube_ldap extends rcube_addressbook
function __construct($p, $debug=false, $mail_domain=NULL)
{
$this->prop = $p;
-
+
if (isset($p['searchonly']))
$this->searchonly = $p['searchonly'];
@@ -447,7 +447,7 @@ class rcube_ldap extends rcube_addressbook
$this->result->searchonly = true;
return $this->result;
}
-
+
// add general filter to query
if (!empty($this->prop['filter']) && empty($this->filter))
{
@@ -1031,6 +1031,11 @@ class rcube_ldap extends rcube_addressbook
else
$out[$rf] = $value;
}
+
+ // Make sure name fields aren't arrays (#1488108)
+ if (is_array($out[$rf]) && in_array($rf, array('name', 'surname', 'firstname', 'middlename', 'nickname'))) {
+ $out[$rf] = $out[$rf][0];
+ }
}
return $out;
diff --git a/program/steps/mail/search.inc b/program/steps/mail/search.inc
index d34454ff1..2e7fd130c 100644
--- a/program/steps/mail/search.inc
+++ b/program/steps/mail/search.inc
@@ -78,7 +78,7 @@ else if(trim($str))
case 'text': $subject['text'] = 'TEXT'; break;
default: $subject[$header] = 'HEADER '.strtoupper($header);
}
-
+
// save search modifiers for the current folder to user prefs
$search_mods = $RCMAIL->config->get('search_mods', $SEARCH_MODS_DEFAULT);
$search_mods[$mbox] = array_fill_keys(array_keys($subject), 1);