From fc7cd35c817a12eff7dd875a97cf0fe892ec3522 Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Sun, 17 Jul 2011 20:36:12 +0200 Subject: [PATCH] MDL-28348 prevent circular references in meta handler for enrolments --- enrol/meta/locallib.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/enrol/meta/locallib.php b/enrol/meta/locallib.php index 3b68e7f40f69b..0f94daeee322e 100644 --- a/enrol/meta/locallib.php +++ b/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;