summaryrefslogtreecommitdiff
path: root/it.class
diff options
context:
space:
mode:
authorUrban Müller2020-11-09 16:23:49 +0100
committerUrban Müller2020-11-09 16:23:49 +0100
commit572e1c052267cd34cbedfcb7d51cda35a55667c1 (patch)
tree94ebe9e33c4b40effc638be92df43180ea6781a4 /it.class
parentb5eac2f8b9f2c38cc8bf95dad7240a55a9c48f89 (diff)
downloaditools-572e1c052267cd34cbedfcb7d51cda35a55667c1.tar.gz
itools-572e1c052267cd34cbedfcb7d51cda35a55667c1.tar.bz2
itools-572e1c052267cd34cbedfcb7d51cda35a55667c1.zip
detect bad it::error usage
Diffstat (limited to 'it.class')
-rw-r--r--it.class5
1 files changed, 4 insertions, 1 deletions
diff --git a/it.class b/it.class
index 7ef1d28..74c9b7c 100644
--- a/it.class
+++ b/it.class
@@ -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