diff options
author | Urban Müller | 2020-11-09 16:23:49 +0100 |
---|---|---|
committer | Urban Müller | 2020-11-09 16:23:49 +0100 |
commit | 572e1c052267cd34cbedfcb7d51cda35a55667c1 (patch) | |
tree | 94ebe9e33c4b40effc638be92df43180ea6781a4 /it.class | |
parent | b5eac2f8b9f2c38cc8bf95dad7240a55a9c48f89 (diff) | |
download | itools-572e1c052267cd34cbedfcb7d51cda35a55667c1.tar.gz itools-572e1c052267cd34cbedfcb7d51cda35a55667c1.tar.bz2 itools-572e1c052267cd34cbedfcb7d51cda35a55667c1.zip |
detect bad it::error usage
Diffstat (limited to 'it.class')
-rw-r--r-- | it.class | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -155,12 +155,15 @@ static function timerlog($label = '') * |graceperiod|timewindow|------> * id x x x m x x x x */ -static function error($p = array()) +static function error($p = array(), $extra = null) { $p = $origp = (array)$p; $p['title'] = $p[0] ?: $p['title']; # handle 'it_error' => "oops" that was cast to array on the way $p['title'] = grapheme_substr($p['title'], 0, 2000); + if ($extra) + it::error('extraneous params passed to it::error'); + 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 |