File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -314,11 +314,13 @@ public function run(): void
314
314
}
315
315
316
316
if ($ foundRoute === false ) {
317
+ $ this ->response ()->setStatusCode (Response::HTTP_NOT_FOUND );
317
318
$ this ->routerCommand ()->sendResponse (
318
319
call_user_func ($ this ->notFoundCallback , $ this ->request (), $ this ->response ())
319
320
);
320
321
}
321
322
} catch (Exception $ e ) {
323
+ $ this ->response ()->setStatusCode (Response::HTTP_INTERNAL_SERVER_ERROR );
322
324
if ($ this ->debug ) {
323
325
die ("Fatal error: Uncaught {$ e }" );
324
326
}
@@ -632,6 +634,11 @@ protected function setPaths(array $params): void
632
634
$ this ->baseFolder = rtrim ($ params ['base_folder ' ], '/ ' );
633
635
}
634
636
637
+ $ basePath = str_replace ($ this ->request ()->server ->get ('DOCUMENT_ROOT ' ), '' , $ this ->baseFolder );
638
+ if (($ baseFolder = $ this ->clearRouteName ($ basePath )) !== '/ ' ) {
639
+ $ this ->baseFolder = $ baseFolder ;
640
+ }
641
+
635
642
if (isset ($ params ['main_method ' ])) {
636
643
$ this ->mainMethod = $ params ['main_method ' ];
637
644
}
You can’t perform that action at this time.
0 commit comments