Skip to content

Commit 29357ac

Browse files
committed
Security: Fix potential XSS in course catalogue - refs BT#21427
1 parent 5a66124 commit 29357ac

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

main/inc/lib/CoursesAndSessionsCatalog.class.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -320,11 +320,11 @@ public static function getLimitFilterFromArray($limit)
320320
* @param string $categoryCode
321321
* @param int $randomValue
322322
* @param array $limit will be used if $randomValue is not set.
323-
* This array should contains 'start' and 'length' keys
323+
* This array should contain 'start' and 'length' keys
324324
*
325325
* @return array
326326
*/
327-
public static function getCoursesInCategory($categoryCode, $randomValue = null, $limit = [])
327+
public static function getCoursesInCategory(string $categoryCode, $randomValue = null, $limit = [])
328328
{
329329
$tbl_course = Database::get_main_table(TABLE_MAIN_COURSE);
330330
$avoidCoursesCondition = self::getAvoidCourseCondition();
@@ -1990,7 +1990,7 @@ public static function getCatalogUrl(
19901990
$action = isset($action) ? Security::remove_XSS($action) : $requestAction;
19911991
$searchTerm = isset($_REQUEST['search_term']) ? Security::remove_XSS($_REQUEST['search_term']) : '';
19921992
$keyword = isset($_REQUEST['keyword']) ? Security::remove_XSS($_REQUEST['keyword']) : '';
1993-
$searchTag = $_REQUEST['search_tag'] ?? '';
1993+
$searchTag = $_REQUEST['search_tag'] ? Security::remove_XSS($_REQUEST['search_tag']) : '';
19941994

19951995
if ($action === 'subscribe_user_with_password') {
19961996
$action = 'subscribe';

0 commit comments

Comments
 (0)