From ecf39dcf080f1ab0e2feff131087340ea46a2807 Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Mon, 21 Sep 2009 19:58:35 -0400 Subject: [PATCH] Protect against infinite recursion in case someone is silly enough to add a resource to one of the resource's own events. --- kronolith/lib/Event.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kronolith/lib/Event.php b/kronolith/lib/Event.php index 28dd9053c..d33c46054 100644 --- a/kronolith/lib/Event.php +++ b/kronolith/lib/Event.php @@ -325,6 +325,11 @@ abstract class Kronolith_Event $add_events = array(); foreach ($this->getResources() as $id => $resourceData) { $resource = Kronolith::getDriver('Resource')->getResource($id); + // Protect against infinite recursion if someone tries to add a + // resource to it's own event. + if ($resource->get('calendar') == $this->getCalendar()) { + continue; + } $response = $resource->getResponse($this); if ($response == Kronolith::RESPONSE_ACCEPTED) { $add_events[] = $resource; -- 2.11.0