From: Michael J. Rubinsky Date: Mon, 21 Sep 2009 23:58:35 +0000 (-0400) Subject: Protect against infinite recursion in case someone is silly enough to X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=ecf39dcf080f1ab0e2feff131087340ea46a2807;p=horde.git Protect against infinite recursion in case someone is silly enough to add a resource to one of the resource's own events. --- 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;