From 2c4a3b520f024c75bddd926c3ac8eedf9e08ef72 Mon Sep 17 00:00:00 2001 From: xboard Date: Thu, 16 Jan 2025 22:04:40 +0800 Subject: [PATCH] fix: handle null parameter in str_replace to resolve deprecation warning in ClientController --- app/Http/Controllers/V1/Client/ClientController.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/V1/Client/ClientController.php b/app/Http/Controllers/V1/Client/ClientController.php index 28649d5..ff9a9f0 100644 --- a/app/Http/Controllers/V1/Client/ClientController.php +++ b/app/Http/Controllers/V1/Client/ClientController.php @@ -166,7 +166,10 @@ class ClientController extends Controller private function getFilterArray(?string $filter): ?array { - return mb_strlen((string) $filter) > 20 ? null : + if ($filter === null) { + return null; + } + return mb_strlen($filter) > 20 ? null : explode('|', str_replace(['|', '|', ','], '|', $filter)); }