Skip to content

Commit 0de0715

Browse files
committed
Fix non string value default page on PageRouter::pageBasedRoute()
1 parent d0e17bd commit 0de0715

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/PageRouter.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use CodeIgniter\HTTP\Exceptions\BadRequestException;
1919
use CodeIgniter\HTTP\ResponseInterface;
2020
use CodeIgniter\Router\Router;
21+
use RuntimeException;
2122

2223
/**
2324
* Page based router.
@@ -70,6 +71,10 @@ public function pageBasedRoute(string $uri)
7071
// Set default page for root uri
7172
if ($uri === '' || $uri === '0') {
7273
$uri = config('App')->defaultPage ?? 'home';
74+
75+
if (! is_string($uri)) {
76+
throw new RuntimeException('App Config defaultPage must be a string.');
77+
}
7378
}
7479

7580
// Set default variables

0 commit comments

Comments
 (0)