Skip to content

Commit

Permalink
MDL-28348 prevent circular references in meta handler for enrolments
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Jul 17, 2011
1 parent 5b2904c commit fc7cd35
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions enrol/meta/locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@ public function user_enrolled($ue) {
return true;
}

if ($ue->enrol === 'meta') {
// prevent circular dependencies - we can not sync meta enrolments recursively
return true;
}

// does anything want to sync with this parent?
if (!$enrols = $DB->get_records('enrol', array('customint1'=>$ue->courseid, 'enrol'=>'meta'), 'id ASC')) {
return true;
Expand Down

0 comments on commit fc7cd35

Please sign in to comment.