route/user.php 第 357-359 行:
$smtplist = include _include(APP_PATH.'conf/smtp.conf.php');
$n = array_rand($smtplist);
$smtp = $smtplist[$n];
当 conf/smtp.conf.php 不存在时,include 返回 false。PHP 7.x 下 array_rand(false) 仅抛 Warning 继续执行;PHP 8.x 下 array_rand() 加了类型约束,直接 TypeError 终止脚本,前端收到空响应。
修复(在 array_rand 前加一行):
$smtplist = is_array($smtplist) ? $smtplist : array(array('host'=>'','port'=>'','user'=>'','pass'=>''));
已在 PHP 8.3 + Nginx + MySQL 8 环境验证通过