We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents d0e17bd + 76962f0 commit 7e74fd7Copy full SHA for 7e74fd7
src/PageRouter.php
@@ -18,6 +18,7 @@
18
use CodeIgniter\HTTP\Exceptions\BadRequestException;
19
use CodeIgniter\HTTP\ResponseInterface;
20
use CodeIgniter\Router\Router;
21
+use RuntimeException;
22
23
/**
24
* Page based router.
@@ -68,8 +69,12 @@ public function pageBasedRoute(string $uri)
68
69
$uri = trim($uri, '/');
70
71
// Set default page for root uri
- if ($uri === '' || $uri === '0') {
72
+ if ($uri === '') {
73
$uri = config('App')->defaultPage ?? 'home';
74
+
75
+ if (! is_string($uri)) {
76
+ throw new RuntimeException('App Config defaultPage must be a string.');
77
+ }
78
}
79
80
// Set default variables
0 commit comments