1
0
mirror of synced 2024-12-05 03:16:04 +03:00

add looping protection

This commit is contained in:
Vitaly Artemev 2016-12-13 17:12:28 +04:00 committed by GitHub
parent 78ff226a17
commit 68ba68af23

View File

@ -92,12 +92,15 @@ class RCrmIcml
{
$url = '/' . $obj->getAltName();
$ids = array($obj->getRel());
$parent = new umiHierarchyElement($obj->getRel());
while (true) {
$url = '/' . $parent->getAltName() . $url;
if ($parent->getRel() != 0) {
if ($parent->getRel() != 0 && !in_array($parent->getRel(), $ids)) {
$parent = new umiHierarchyElement($parent->getRel());
array_push($ids, $parent->getRel());
} else {
break;
}
@ -306,4 +309,4 @@ class RCrmIcml
}
}
}
}
}