From 492425a06dab0e78a7a33426e74742e88b1eb4fe Mon Sep 17 00:00:00 2001 From: kenjis Date: Sat, 30 Mar 2024 09:33:16 +0900 Subject: [PATCH] fix: TypeError in Filters TypeError: urldecode(): Argument #1 ($string) must be of type string, null given --- system/Filters/Filters.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/system/Filters/Filters.php b/system/Filters/Filters.php index fa27dc7b518d..963638bdfb8f 100644 --- a/system/Filters/Filters.php +++ b/system/Filters/Filters.php @@ -376,6 +376,8 @@ private function setToolbarToLast(array $filters, bool $remove = false): array * * @param string|null $uri URI path relative to baseURL (all lowercase) * + * @TODO We don't need to accept null as $uri. + * * @return Filters */ public function initialize(?string $uri = null) @@ -385,7 +387,7 @@ public function initialize(?string $uri = null) } // Decode URL-encoded string - $uri = urldecode($uri); + $uri = urldecode($uri ?? ''); $oldFilterOrder = config(Feature::class)->oldFilterOrder ?? false; if ($oldFilterOrder) {