Skip to content

Commit

Permalink
MDL-74075 core_badges: Check accepted criterias
Browse files Browse the repository at this point in the history
  • Loading branch information
Amaia Anabitarte authored and sarjona committed Mar 9, 2022
1 parent bf84224 commit c36ab09
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions badges/criteria_settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@
redirect($return);
}

// Make sure the criteria type is accepted.
$accepted = $badge->get_accepted_criteria();
if (!in_array($type, $accepted)) {
redirect($return);
}

if ($badge->type == BADGE_TYPE_COURSE) {
require_login($badge->courseid);
$course = get_course($badge->courseid);
Expand Down

0 comments on commit c36ab09

Please sign in to comment.