Skip to content

Commit

Permalink
Merge branch 'release-0.7' of github.com:roundcube/roundcubemail into…
Browse files Browse the repository at this point in the history
… release-0.7
  • Loading branch information
thomascube committed Nov 6, 2012
2 parents f9a25bd + b1263ab commit a5c8786
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 20 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
@@ -1,6 +1,7 @@
CHANGELOG Roundcube Webmail
===========================

- Fix compatybility with MDB2 2.5.0b4 (#1488779)
- Fix lower-casing email address on replies (#1488598)
- Fix so subscribed non-existing/non-accessible shared folder can be unsubscribed

Expand Down
5 changes: 5 additions & 0 deletions program/include/rcube_addressbook.php
Expand Up @@ -431,6 +431,11 @@ function get_col_values($col, $data, $flat = false)
}
}

// remove duplicates
if ($flat && !empty($out)) {
$out = array_unique($out);
}

return $out;
}

Expand Down
36 changes: 19 additions & 17 deletions program/include/rcube_ldap.php
Expand Up @@ -770,24 +770,26 @@ function search($fields, $value, $mode=0, $select=true, $nocount=false, $require

for ($i = 0; $i < $entries['count']; $i++) {
$rec = $this->_ldap2result($entries[$i]);
foreach (array('email', 'name') as $f) {
$val = mb_strtolower($rec[$f]);
switch ($mode) {
case 1:
$got = ($val == $search);
break;
case 2:
$got = ($search == substr($val, 0, strlen($search)));
break;
default:
$got = (strpos($val, $search) !== false);
break;
}
foreach ($fields as $f) {
foreach ((array)$rec[$f] as $val) {
$val = mb_strtolower($val);
switch ($mode) {
case 1:
$got = ($val == $search);
break;
case 2:
$got = ($search == substr($val, 0, strlen($search)));
break;
default:
$got = (strpos($val, $search) !== false);
break;
}

if ($got) {
$this->result->add($rec);
$this->result->count++;
break;
if ($got) {
$this->result->add($rec);
$this->result->count++;
break 2;
}
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions program/include/rcube_mdb2.php
Expand Up @@ -197,7 +197,7 @@ function is_error()
*/
function is_connected()
{
return PEAR::isError($this->db_handle) ? false : $this->db_connected;
return is_a($this->db_handle, 'PEAR_Error') ? false : $this->db_connected;
}


Expand Down Expand Up @@ -285,7 +285,7 @@ private function _query($query, $offset, $numrows, $params)
else {
$params = (array)$params;
$q = $this->db_handle->prepare($query, null, $mode=='w' ? MDB2_PREPARE_MANIP : null);
if ($this->db_handle->isError($q)) {
if (MDB2::isError($q)) {
$this->db_error = true;
$this->db_error_msg = $q->userinfo;

Expand Down Expand Up @@ -366,7 +366,7 @@ function insert_id($table = '')

$id = $this->db_handle->lastInsertID($table);

return $this->db_handle->isError($id) ? null : $id;
return MDB2::isError($id) ? null : $id;
}


Expand Down

0 comments on commit a5c8786

Please sign in to comment.