add looping protection
This commit is contained in:
parent
78ff226a17
commit
68ba68af23
@ -92,12 +92,15 @@ class RCrmIcml
|
|||||||
{
|
{
|
||||||
$url = '/' . $obj->getAltName();
|
$url = '/' . $obj->getAltName();
|
||||||
|
|
||||||
|
$ids = array($obj->getRel());
|
||||||
$parent = new umiHierarchyElement($obj->getRel());
|
$parent = new umiHierarchyElement($obj->getRel());
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
$url = '/' . $parent->getAltName() . $url;
|
$url = '/' . $parent->getAltName() . $url;
|
||||||
|
|
||||||
if ($parent->getRel() != 0) {
|
if ($parent->getRel() != 0 && !in_array($parent->getRel(), $ids)) {
|
||||||
$parent = new umiHierarchyElement($parent->getRel());
|
$parent = new umiHierarchyElement($parent->getRel());
|
||||||
|
array_push($ids, $parent->getRel());
|
||||||
} else {
|
} else {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -306,4 +309,4 @@ class RCrmIcml
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user