Avoid the news search for users without groups

This commit is contained in:
Alejandro Gallardo Escobar 2018-04-09 17:17:01 +02:00
parent 4d9ebb90b1
commit d1608400f9
1 changed files with 4 additions and 0 deletions

View File

@ -2273,6 +2273,10 @@ function get_news($arguments) {
$limit = get_argument ('limit', $arguments, 99999999);
$id_group = array_keys(users_get_groups($id_user, false, true));
// Empty groups
if (empty($id_group)) return array();
$id_group = implode(',',$id_group);
$current_datetime = date('Y-m-d H:i:s', time());
$modal = (int) $modal;