Permalink
Browse files

MDL-28348 prevent circular references in meta handler for enrolments

  • Loading branch information...
1 parent d5cb69e commit dd6142b7d2dd5fe3576c248d30cb64dbedc74a13 @skodak skodak committed Jul 17, 2011
Showing with 5 additions and 0 deletions.
  1. +5 −0 enrol/meta/locallib.php
@@ -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;

0 comments on commit dd6142b

Please sign in to comment.