diff --git a/wa-apps/team/lib/classes/teamUser.class.php b/wa-apps/team/lib/classes/teamUser.class.php index 21fa16e27..b0859ba53 100644 --- a/wa-apps/team/lib/classes/teamUser.class.php +++ b/wa-apps/team/lib/classes/teamUser.class.php @@ -106,6 +106,11 @@ public static function getList($collection_hash, $options = array(), &$total_cou // Order by $order_by = ifset($options['order']); + if ($order_by) { + $order_by = preg_replace('/[^\w\s]+/', '', $order_by); + } else { + $order_by = 'name ASC'; + } if ($order_by === 'from_user_settings') { $order_by = wa()->getUser()->getSettings(wa()->getApp(), 'sort', 'last_seen'); if (!$order_by) { @@ -120,9 +125,6 @@ public static function getList($collection_hash, $options = array(), &$total_cou case 'last_seen': $order_by = 'last_datetime DESC'; break; - default: - $order_by = 'name ASC'; - break; } $order_by = explode(' ', $order_by);