diff options
author | Urban Müller | 2021-02-15 14:09:26 +0100 |
---|---|---|
committer | Urban Müller | 2021-02-15 14:09:26 +0100 |
commit | d81ae97a311a0e82a5b5f2dea6b75a8e5fdbdd69 (patch) | |
tree | cfd939bd4054d4747c1b81b25af107ea553cf17e | |
parent | ca0e57eb0c65ac41ca24903e58ce0a8168eebf30 (diff) | |
download | itools-d81ae97a311a0e82a5b5f2dea6b75a8e5fdbdd69.tar.gz itools-d81ae97a311a0e82a5b5f2dea6b75a8e5fdbdd69.tar.bz2 itools-d81ae97a311a0e82a5b5f2dea6b75a8e5fdbdd69.zip |
grapheme_substr turns false into "" in php 8; return was not taken
-rw-r--r-- | it.class | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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 |