diff --git a/magmi/inc/magmi_engine.php b/magmi/inc/magmi_engine.php index 74b735a9..55e1c94b 100755 --- a/magmi/inc/magmi_engine.php +++ b/magmi/inc/magmi_engine.php @@ -390,10 +390,11 @@ public function getExceptionTrace($tk, &$traces) { $this->_excid++; $trstr = ""; - //FIXME: infinity loop in M2 + //todo: improve infinity loop handling in M2 + $counter = 0; foreach ($traces as $trace) { if (isset($trace["file"])) { - $fname = str_replace(dirname(dirname(__FILE__)), "", $trace["file"]); + $fname = str_replace(dirname(__DIR__), "", $trace["file"]); $trstr .= $fname . ":" . (isset($trace["line"]) ? $trace["line"] : "?") . " - "; if (isset($trace["class"])) { $trstr .= $trace["class"] . "->"; @@ -407,6 +408,10 @@ public function getExceptionTrace($tk, &$traces) $trstr .= "\n"; } } + // simple max trace depth fix + if (++$counter % 20) { + break; + } } if (!isset($this->_exceptions[$tk])) { $this->_exceptions[$tk] = array(0,$this->_excid);