From 8cc6b18bcda5a20e5e07f629d93ddb444d8c2e8d Mon Sep 17 00:00:00 2001 From: Aleksander Machniak <alec@alec.pl> Date: Thu, 02 Jul 2015 04:09:44 -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 91309c0..3ad7fec 100644 --- a/program/lib/Roundcube/rcube_ldap.php +++ b/program/lib/Roundcube/rcube_ldap.php @@ -834,15 +834,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