From c13b9eb147a3aba093e8ce0ac9ed50cfd2f48b8f Mon Sep 17 00:00:00 2001 From: ken678 <530765310@qq.com> Date: Tue, 23 Sep 2025 15:28:46 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=80=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/common/controller/Backend.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/common/controller/Backend.php b/application/common/controller/Backend.php index 97ae42e5..e49dd527 100644 --- a/application/common/controller/Backend.php +++ b/application/common/controller/Backend.php @@ -581,7 +581,7 @@ class Backend extends Controller } else { $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['pid'] = (int)($item['pid'] ?? $item['parent_id'] ?? 0); // 修改为安全的htmlentities调用,兼容php8+版本 $result = array_map(function($value) { return $value === null ? '' : htmlentities((string)$value); -- Gitee