fix: guard match live validator scalars

This commit is contained in:
hajimi
2026-06-21 12:08:40 +08:00
parent cd9530686c
commit 7ebd563134
2 changed files with 9 additions and 0 deletions
@@ -69,6 +69,9 @@ class MatchLiveValidate extends BaseValidate
public function checkTrimmedTitle($value)
{
if (!is_scalar($value)) {
return '直播标题格式错误';
}
$value = trim((string) $value);
if ($value === '') {
return '直播标题不能为空';
@@ -81,6 +84,9 @@ class MatchLiveValidate extends BaseValidate
public function checkTrimmedSourceUrl($value)
{
if (!is_scalar($value)) {
return '源地址格式错误';
}
$value = trim((string) $value);
if ($value === '') {
return '源地址不能为空';