try {
$this->isACPRequest = $isACPRequest;
+ // This must be called before the PSR request is created, because it registers the
+ // route paramters in $_GET.
+ $routeMatches = RouteHandler::getInstance()->matches();
+
try {
$psrRequest = ServerRequestFactory::fromGlobals(
null, // $_SERVER
throw new NamedUserException('Failed to parse the incoming request.', 0, $e);
}
- if (RouteHandler::getInstance()->matches()) {
+ if ($routeMatches) {
$builtRequest = $this->buildRequest($psrRequest, $application);
} else {
if (ENABLE_DEBUG_MODE) {