From 4c64ffc02e94acbe7cca9338f62d03f2d4208fbe Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Tue, 5 Aug 2014 13:31:19 -0600 Subject: [PATCH] [mms] Make case-insensitive API e-mail search work on non-ASCII data (Request #12480). --- turba/docs/CHANGES | 2 ++ turba/lib/Api.php | 6 +++--- turba/package.xml | 4 +++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/turba/docs/CHANGES b/turba/docs/CHANGES index c8f5647e66b..69ae6928cc2 100644 --- a/turba/docs/CHANGES +++ b/turba/docs/CHANGES @@ -2,6 +2,8 @@ v4.2.2-git ---------- +[mms] Make case-insensitive API e-mail search work on non-ASCII data (Request + #12480). [jan] Fix listing group members that contain colons in their IDs. diff --git a/turba/lib/Api.php b/turba/lib/Api.php index f361569581e..0948c39a9ad 100644 --- a/turba/lib/Api.php +++ b/turba/lib/Api.php @@ -1264,13 +1264,13 @@ public function search($names = null, array $opts = array()) ($attributes[$key]['type'] == 'email')) { $e_val = $ob->getValue($key); - /* Bug #12480: Don't return email if it + /* Ticket #12480: Don't return email if it * doesn't contain the search string, since * an entry can contain multiple e-mail * fields. Return all e-mails if it * occurrs in the name. */ - if ((stripos($e_val, $name) !== false) || - (stripos($display_name, $name) !== false)) { + if ((Horde_String::ipos($e_val, $name) !== false) || + (Horde_String::ipos($display_name, $name) !== false)) { // Multiple addresses support $email->add($rfc822->parseAddressList($e_val, array( 'limit' => (isset($attributes[$key]['params']) && is_array($attributes[$key]['params']) && !empty($attributes[$key]['params']['allow_multi'])) ? 0 : 1 diff --git a/turba/package.xml b/turba/package.xml index abc6d9dcecb..9e9afdc512d 100644 --- a/turba/package.xml +++ b/turba/package.xml @@ -39,6 +39,7 @@ ASL +* [mms] Make case-insensitive API e-mail search work on non-ASCII data (Request #12480). * [jan] Fix listing group members that contain colons in their IDs. @@ -787,7 +788,7 @@ Horde_Util pear.horde.org - 2.0.0 + 2.5.0 3.0.0alpha1 3.0.0alpha1 @@ -1913,6 +1914,7 @@ 2014-08-04 ASL +* [mms] Make case-insensitive API e-mail search work on non-ASCII data (Request #12480). * [jan] Fix listing group members that contain colons in their IDs.