From 0524cba8a9456108e928adc5d64ddf22f0c9b7c8 Mon Sep 17 00:00:00 2001 From: wanghousheng Date: Wed, 31 Jan 2024 01:33:26 +0800 Subject: [PATCH] 1 --- app/api/controller/Recovery.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/api/controller/Recovery.php b/app/api/controller/Recovery.php index 4ff14c11..533cd656 100644 --- a/app/api/controller/Recovery.php +++ b/app/api/controller/Recovery.php @@ -68,8 +68,10 @@ class Recovery extends Controller public function add(): Json { $imageIds = $this->request->post('image_ids'); - if (!is_array($imageIds)) { + if ($imageIds && !is_array($imageIds)) { $imageIds = explode(',', $imageIds); + } else { + $imageIds = []; } $shop_id = intval($this->request->post('shop_id')); if (!$shop_id) {