mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-07-11 20:22:12 +00:00
Merge pull request #655 from skipperbent/v5-development
Version 5.3.0.1
This commit is contained in:
@@ -59,7 +59,7 @@ class Router
|
|||||||
* when a route is being processed.
|
* when a route is being processed.
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected array$routeStack = [];
|
protected array $routeStack = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List of added bootmanagers
|
* List of added bootmanagers
|
||||||
@@ -345,7 +345,7 @@ class Router
|
|||||||
try {
|
try {
|
||||||
/* Verify csrf token for request */
|
/* Verify csrf token for request */
|
||||||
$this->csrfVerifier->handle($this->request);
|
$this->csrfVerifier->handle($this->request);
|
||||||
} catch(Exception $e) {
|
} catch (Exception $e) {
|
||||||
return $this->handleException($e);
|
return $this->handleException($e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -443,10 +443,14 @@ class Router
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (Exception $e) {
|
} catch (\Throwable $e) {
|
||||||
|
if ($e instanceof Exception) {
|
||||||
return $this->handleException($e);
|
return $this->handleException($e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $this->handleException(new Exception($e->getMessage(), $e->getCode()));
|
||||||
|
}
|
||||||
|
|
||||||
if ($methodNotAllowed === true) {
|
if ($methodNotAllowed === true) {
|
||||||
$message = sprintf('Route "%s" or method "%s" not allowed.', $this->request->getUrl()->getPath(), $this->request->getMethod());
|
$message = sprintf('Route "%s" or method "%s" not allowed.', $this->request->getUrl()->getPath(), $this->request->getMethod());
|
||||||
return $this->handleException(new NotFoundHttpException($message, 403));
|
return $this->handleException(new NotFoundHttpException($message, 403));
|
||||||
|
|||||||
Reference in New Issue
Block a user