Browse Source

[svn r13737] Minor - Fixed code to avoid warning

Yannick Warnier 17 years ago
parent
commit
a23ee23c04
1 changed files with 7 additions and 5 deletions
  1. 7 5
      main/user/user.php

+ 7 - 5
main/user/user.php

@@ -90,11 +90,13 @@ if(api_is_allowed_to_edit())
 		{
 			case 'unsubscribe' :
 				// Make sure we don't unsubscribe current user from the course
-				$user_ids = array_diff($_POST['user'],array($_user['user_id']));
-				if(count($user_ids) > 0)
-				{
-					CourseManager::unsubscribe_user($user_ids, $_SESSION['_course']['sysCode']);
-					$message = get_lang('UsersUnsubscribed');
+				if(is_array($_POST['user'])){
+					$user_ids = array_diff($_POST['user'],array($_user['user_id']));
+					if(count($user_ids) > 0)
+					{
+						CourseManager::unsubscribe_user($user_ids, $_SESSION['_course']['sysCode']);
+						$message = get_lang('UsersUnsubscribed');
+					}
 				}
 				break;
 		}