diff --git a/main/badge/assertion.php b/main/badge/assertion.php index 95b530ef52..bb0b000688 100644 --- a/main/badge/assertion.php +++ b/main/badge/assertion.php @@ -8,14 +8,13 @@ * * @package chamilo.badge */ -header('Content-Type: application/json'); require_once __DIR__.'/../inc/global.inc.php'; -$userId = isset($_GET['user']) ? intval($_GET['user']) : 0; -$skillId = isset($_GET['skill']) ? intval($_GET['skill']) : 0; -$courseId = isset($_GET['course']) ? intval($_GET['course']) : 0; -$sessionId = isset($_GET['session']) ? intval($_GET['session']) : 0; +$userId = isset($_GET['user']) ? (int) $_GET['user'] : 0; +$skillId = isset($_GET['skill']) ? (int) $_GET['skill'] : 0; +$courseId = isset($_GET['course']) ? (int) $_GET['course'] : 0; +$sessionId = isset($_GET['session']) ? (int) $_GET['session'] : 0; if ($userId === 0 || $skillId === 0) { exit; diff --git a/main/badge/class.php b/main/badge/class.php index 90a45ef544..27e9e4ec99 100644 --- a/main/badge/class.php +++ b/main/badge/class.php @@ -10,7 +10,7 @@ */ require_once __DIR__.'/../inc/global.inc.php'; -$skillId = isset($_GET['id']) ? intval($_GET['id']) : 0; +$skillId = isset($_GET['id']) ? (int) $_GET['id'] : 0; $objSkill = new Skill(); $skill = $objSkill->get($skillId); diff --git a/main/forum/viewthread.php b/main/forum/viewthread.php index 3b6c37ca17..5b4a2cdc89 100755 --- a/main/forum/viewthread.php +++ b/main/forum/viewthread.php @@ -687,7 +687,7 @@ if (!api_is_allowed_to_edit(false, true) && if (!api_is_allowed_to_edit(false, true) && ( - ( $current_forum_category && $current_forum_category['locked'] != 0) || + ($current_forum_category && $current_forum_category['locked'] != 0) || $current_forum['locked'] != 0 || $current_thread['locked'] != 0 ) ) { diff --git a/main/work/work.lib.php b/main/work/work.lib.php index c58a6c359f..2b9dd1ea70 100755 --- a/main/work/work.lib.php +++ b/main/work/work.lib.php @@ -4009,6 +4009,7 @@ function processWorkForm( $courseId, $sessionId ); + if (count($userWorks) == 1) { // The student only uploaded one doc so far, so add the // considered work time to his course connection time