summaryrefslogtreecommitdiff
path: root/it.class
diff options
context:
space:
mode:
authorUrban Müller2021-02-15 14:09:26 +0100
committerUrban Müller2021-02-15 14:09:26 +0100
commitd81ae97a311a0e82a5b5f2dea6b75a8e5fdbdd69 (patch)
treecfd939bd4054d4747c1b81b25af107ea553cf17e /it.class
parentca0e57eb0c65ac41ca24903e58ce0a8168eebf30 (diff)
downloaditools-d81ae97a311a0e82a5b5f2dea6b75a8e5fdbdd69.tar.gz
itools-d81ae97a311a0e82a5b5f2dea6b75a8e5fdbdd69.tar.bz2
itools-d81ae97a311a0e82a5b5f2dea6b75a8e5fdbdd69.zip
grapheme_substr turns false into "" in php 8; return was not taken
Diffstat (limited to 'it.class')
-rw-r--r--it.class7
1 files changed, 4 insertions, 3 deletions
diff --git a/it.class b/it.class
index 67488a0..64a03c1 100644
--- a/it.class
+++ b/it.class
@@ -157,6 +157,10 @@ static function timerlog($label = '')
static function error($p = array(), $extra = null)
{
$p = $origp = (array)$p;
+
+ if (error_reporting() == @error_reporting() || $p[0] === false || $p['title'] === false) # called with @ or suppressed
+ return $p['fatal'] ? self::_exit($p) : null;
+
$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);
@@ -167,9 +171,6 @@ static function error($p = array(), $extra = null)
if ($level["class"] . $level["type"] . $level["function"] == "it::error")
return null; # prevent recursion
- if (error_reporting() == @error_reporting() || $p[0] === false || $p['title'] === false) # called with @ or suppressed
- return $p['fatal'] ? self::_exit($p) : null;
-
if ($_SERVER['REMOTE_ADDR'])
$url = "http://" . it::replace([':443$' => ""], $_SERVER['HTTP_HOST']) . $_SERVER['REQUEST_URI']; # we ignore https for easier debugging
else