Fix PHP warning.

1.10.x
Julio Montoya 10 years ago
parent d255e8020b
commit 6edb5b6aa7
  1. 21
      main/inc/lib/course.lib.php

@ -5508,20 +5508,25 @@ class CourseManager
{
$grouplist = array();
$userlist = array();
foreach ($to as $to_item) {
list($type, $id) = explode(':', $to_item);
switch ($type) {
case 'GROUP':
$grouplist[] = intval($id);
break;
case 'USER':
$userlist[] = intval($id);
break;
if (!empty($to_item)) {
list($type, $id) = explode(':', $to_item);
switch ($type) {
case 'GROUP':
$grouplist[] = intval($id);
break;
case 'USER':
$userlist[] = intval($id);
break;
}
}
}
$send_to['groups'] = $grouplist;
$send_to['users'] = $userlist;
return $send_to;
}

Loading…
Cancel
Save