From 3fc0d00f21b44d44ee1cf0513235e1b51340a290 Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Wed, 27 Jun 2018 15:09:12 +0200 Subject: prevent recursion --- it.class | 4 ++++ 1 file changed, 4 insertions(+) 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; -- cgit v1.2.3