From 97803919b5bef33d34bd6523abff298466840044 Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Fri, 12 Mar 2021 18:29:55 +0100 Subject: avoid empty title when error message contains invalid utf8 --- it.class | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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']]; -- cgit v1.2.3