From c771bb9dd79d79a26c3a2a69560c02effb9ae527 Mon Sep 17 00:00:00 2001 From: jmontoyaa Date: Thu, 1 Sep 2016 15:54:51 +0200 Subject: [PATCH] Validate function params --- main/inc/lib/sessionmanager.lib.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/main/inc/lib/sessionmanager.lib.php b/main/inc/lib/sessionmanager.lib.php index 29cbab6c4c..9413725fa9 100755 --- a/main/inc/lib/sessionmanager.lib.php +++ b/main/inc/lib/sessionmanager.lib.php @@ -2776,17 +2776,16 @@ class SessionManager $session_id = api_get_session_id(); } - if (empty($session_id)) { - return false; - } - - if (!empty($courseId)) { $courseId = intval($courseId); } else { $courseId = api_get_course_id(); } + if (empty($session_id) || empty($courseId) || empty($user_id)) { + return false; + } + // Table definition $tbl_session_rel_course_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER); $tbl_session_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_USER);