summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUrban Müller2018-06-27 15:09:12 +0200
committerUrban Müller2018-06-27 15:09:12 +0200
commit3fc0d00f21b44d44ee1cf0513235e1b51340a290 (patch)
treefae897e77bd04f8d56928e5a08e98f63d711bf0e
parentad34103f7af9fb3b1a6830b891aa74a7663960eb (diff)
downloaditools-3fc0d00f21b44d44ee1cf0513235e1b51340a290.tar.gz
itools-3fc0d00f21b44d44ee1cf0513235e1b51340a290.tar.bz2
itools-3fc0d00f21b44d44ee1cf0513235e1b51340a290.zip
prevent recursion
-rw-r--r--it.class4
1 files changed, 4 insertions, 0 deletions
diff --git a/it.class b/it.class
index ce42027..8ca960d 100644
--- a/it.class
+++ b/it.class
@@ -159,6 +159,10 @@ static function error($p = array())
$p = $origp = (array)$p;
$p['title'] = $p[0] ?: $p['title']; # handle 'it_error' => "oops" that was cast to array on the way
+ foreach (array_slice(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 10), 1) as $level)
+ if ($level["class"] . $level["type"] . $level["function"] == "it::error")
+ return null; # prevent recursion
+
if (!error_reporting() || $p[0] === false || $p['title'] === false) # called with @ or suppressed
return null;