From 212e332cef6938d6c80ed650a3a589f7c28c9dd0 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak <alec@alec.pl> Date: Thu, 02 Jul 2015 04:03:24 -0400 Subject: [PATCH] Get rid of array_walk() when simple foreach() can be used --- program/lib/Roundcube/rcube_ldap.php | 11 ++++------- 1 files changed, 4 insertions(+), 7 deletions(-) diff --git a/program/lib/Roundcube/rcube_ldap.php b/program/lib/Roundcube/rcube_ldap.php index e6d79c1..e8f9a8e 100644 --- a/program/lib/Roundcube/rcube_ldap.php +++ b/program/lib/Roundcube/rcube_ldap.php @@ -833,15 +833,12 @@ } else { // map address book fields into ldap attributes - $me = $this; $attributes = array(); - $fields = (array) $fields; - - array_walk($fields, function($field) use ($me, &$attributes) { - if ($me->coltypes[$field] && ($attrs = (array)$me->coltypes[$field]['attributes'])) { - $attributes = array_merge($attributes, $attrs); + foreach ((array) $fields as $field) { + if ($this->coltypes[$field] && ($attrs = $this->coltypes[$field]['attributes'])) { + $attributes = array_merge($attributes, (array) $attrs); } - }); + } } // compose a full-text-like search filter -- Gitblit v1.9.1