From bcb22e45ef8065d0baf5038e983f6284a9dba895 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 27 Oct 2006 12:03:37 +0000 Subject: [PATCH] php < 5.1 fix for the advanced search --- addressbook/inc/class.uicontacts.inc.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/addressbook/inc/class.uicontacts.inc.php b/addressbook/inc/class.uicontacts.inc.php index 3b41d42118..b051389755 100644 --- a/addressbook/inc/class.uicontacts.inc.php +++ b/addressbook/inc/class.uicontacts.inc.php @@ -1462,3 +1462,21 @@ $readonlys['button[vcard]'] = true; $GLOBALS['egw']->common->egw_footer(); } } + +if (!function_exists('array_intersect_key')) // php5.1 function +{ + function array_intersect_key($array1,$array2) + { + $intersection = $keys = array(); + foreach(func_get_args() as $arr) + { + $keys[] = array_keys((array)$arr); + } + foreach(call_user_func_array('array_intersect',$keys) as $key) + { + $intersection[$key] = $array1[$key]; + } + return $intersection; + } +} +