fix an usort sideeffect

This commit is contained in:
Carsten Wolff 2005-09-30 16:05:35 +00:00
parent 951a4c8ec6
commit 95aa6563f5

View File

@ -459,7 +459,9 @@
. $this->stock_contact_fields['n_given'] . "', '"
. $this->stock_contact_fields['email'] . "')";
}
# a little bit of functional programming
# remove the "count" field from the array, because usort screws up associative arrays
unset($ldap_fields['count']);
# sort the array
$function = 'return contacts::_cmp(' . $order_array . ",'" . $sort . "'," . '$a, $b);';
usort($ldap_fields, create_function('$a, $b', $function));