mirror of
https://github.com/flarum/core.git
synced 2025-05-06 07:25:22 +02:00
Merge branch 'master' of https://github.com/flarum/core
This commit is contained in:
commit
2e27d5938a
13
error/403.html
Normal file
13
error/403.html
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head lang="en">
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title></title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<h1>403 Forbidden</h1>
|
||||||
|
<p>You do not have permissions to access this page.</p>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -14,4 +14,8 @@ use Exception;
|
|||||||
|
|
||||||
class PermissionDeniedException extends Exception
|
class PermissionDeniedException extends Exception
|
||||||
{
|
{
|
||||||
|
public function __construct($message = null, $code = 403, Exception $previous = null)
|
||||||
|
{
|
||||||
|
parent::__construct($message, $code, $previous);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,7 @@ class HandleErrors implements ErrorMiddlewareInterface
|
|||||||
$status = $errorCode;
|
$status = $errorCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->debug && $errorCode !== 404) {
|
if ($this->debug && ! in_array($errorCode, [403, 404])) {
|
||||||
$whoops = new WhoopsMiddleware;
|
$whoops = new WhoopsMiddleware;
|
||||||
|
|
||||||
return $whoops($error, $request, $response, $out);
|
return $whoops($error, $request, $response, $out);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user