diff --git a/main/inc/lib/api.lib.php b/main/inc/lib/api.lib.php index 6af3a95482..ebc7ce4ba6 100644 --- a/main/inc/lib/api.lib.php +++ b/main/inc/lib/api.lib.php @@ -6066,9 +6066,9 @@ function api_get_tools_lists($my_tool = null) { * @param int user id * @return bool true if we pass false otherwise */ -function api_check_term_condition($user_id) { +function api_check_term_condition($user_id) +{ if (api_get_setting('allow_terms_conditions') == 'true') { - //check if exists terms and conditions if (LegalManager::count() == 0) { return true; @@ -6080,8 +6080,8 @@ function api_check_term_condition($user_id) { 'legal_accept' ); - if (!empty($data) && isset($data[0])) { - $rowv = $data[0]; + if (!empty($data) && isset($data['value'])) { + $rowv = $data['value']; $user_conditions = explode(':', $rowv); $version = $user_conditions[0]; $lang_id = $user_conditions[1];