"only allow valid order criteria"

This commit is contained in:
Ralf Becker 2008-08-21 05:56:46 +00:00
parent 0f2b4d7914
commit e433a67c7a

View File

@ -127,7 +127,10 @@ class egw_session_files
if(!$all_no_sort)
{
if(!$order) $order = 'session_dla';
if(!$order || !in_array($order,array('session_lid','session_ip','session_logintime','session_action','session_dla')))
{
$order = 'session_dla';
}
uasort($values,create_function('$a,$b','return '.(!strcasecmp($sort,'ASC') ? '' : '-').'strcasecmp($a['.$order.'],$b['.$order.']);'));
return array_slice($values,(int)$start,$maxmatchs);
}