summaryrefslogtreecommitdiff
path: root/it.class
diff options
context:
space:
mode:
authorUrban Müller2021-03-12 18:29:55 +0100
committerUrban Müller2021-03-12 18:29:55 +0100
commit97803919b5bef33d34bd6523abff298466840044 (patch)
tree2575aa7a79f92ed66d7120205b7aba41dce818ba /it.class
parenta8a79ede824088ecb1aee300b04c2cd96b8f1399 (diff)
downloaditools-97803919b5bef33d34bd6523abff298466840044.tar.gz
itools-97803919b5bef33d34bd6523abff298466840044.tar.bz2
itools-97803919b5bef33d34bd6523abff298466840044.zip
avoid empty title when error message contains invalid utf8
Diffstat (limited to 'it.class')
-rw-r--r--it.class2
1 files changed, 1 insertions, 1 deletions
diff --git a/it.class b/it.class
index 723a202..0c356d5 100644
--- a/it.class
+++ b/it.class
@@ -162,7 +162,7 @@ static function error($p = array(), $extra = null)
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);
+ $p['title'] = grapheme_substr($p['title'], 0, 2000) ?: substr($p['title'], 0, 2000);
if ($extra)
$p = ['title' => 'extraneous params passed to it::error', 'fatal' => $p['fatal']];