Skip to content

Commit 492425a

Browse files
committed
fix: TypeError in Filters
TypeError: urldecode(): Argument #1 ($string) must be of type string, null given
1 parent 96ce795 commit 492425a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

system/Filters/Filters.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,8 @@ private function setToolbarToLast(array $filters, bool $remove = false): array
376376
*
377377
* @param string|null $uri URI path relative to baseURL (all lowercase)
378378
*
379+
* @TODO We don't need to accept null as $uri.
380+
*
379381
* @return Filters
380382
*/
381383
public function initialize(?string $uri = null)
@@ -385,7 +387,7 @@ public function initialize(?string $uri = null)
385387
}
386388

387389
// Decode URL-encoded string
388-
$uri = urldecode($uri);
390+
$uri = urldecode($uri ?? '');
389391

390392
$oldFilterOrder = config(Feature::class)->oldFilterOrder ?? false;
391393
if ($oldFilterOrder) {

0 commit comments

Comments
 (0)