diff --git a/app/common/service/UsedCarService.php b/app/common/service/UsedCarService.php index 3b26bbf..804c980 100644 --- a/app/common/service/UsedCarService.php +++ b/app/common/service/UsedCarService.php @@ -141,7 +141,11 @@ class UsedCarService $asc = ord($s[0]); if ($asc >= 65 && $asc <= 90) return $char; - + + // 转码失败或长度不足 + if ($s === false || strlen($s) < 2) { + return ''; + } $code = ord($s[0]) * 256 + ord($s[1]) - 65536; $map = [