Fix type error when null is passed to cut_str()

https://xetown.com/questions/1793588
This commit is contained in:
Kijin Sung 2023-11-05 20:24:07 +09:00
parent d02ea160c1
commit 7132ef4c00

View file

@ -435,6 +435,7 @@ function isSiteID($domain): bool
*/
function cut_str($string, $cut_size = 0, $tail = '...'): string
{
$string = (string)$string;
if($cut_size < 1 || !$string)
{
return $string;