Update Backend.php

修改为安全的htmlentities调用,兼容php8+版本
pull/515/head
unsetMe 2025-04-07 23:17:49 +08:00 committed by Karson
parent a909967bd4
commit bcbfa4a9e4
1 changed files with 4 additions and 1 deletions

View File

@ -582,7 +582,10 @@ class Backend extends Controller
$result = array_intersect_key(($item instanceof Model ? $item->toArray() : (array)$item), array_flip($fields));
}
$result['pid'] = isset($item['pid']) ? $item['pid'] : (isset($item['parent_id']) ? $item['parent_id'] : 0);
$result = array_map("htmlentities", $result);
// 修改为安全的htmlentities调用兼容php8+版本
$result = array_map(function($value) {
return $value === null ? '' : htmlentities((string)$value);
}, $result);
$list[] = $result;
}
if ($istree && !$primaryvalue) {