check if we are already trying to unlink the entry, to avoid an infinit recursion

This commit is contained in:
Ralf Becker 2011-09-15 16:35:28 +00:00
parent fc3fc728a4
commit 93b7e6885c

View File

@ -738,7 +738,14 @@ class egw_link extends solink
if ($id && is_null($title)) // $app,$id has been deleted ==> unlink all links to it
{
static $unlinking = array();
// check if we are already trying to unlink the entry, to avoid an infinit recursion
if (!isset($unlinking[$app]) || !isset($unlinking[$app][$id]))
{
$unlinking[$app][$id] = true;
self::unlink(0,$app,$id);
unset($unlinking[$app][$id]);
}
if (self::DEBUG) echo '<p>'.__METHOD__."('$app','$id') unlinked, as $method returned null</p>\n";
return False;
}