aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/container/ContainerBuilder.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2020-09-12 12:42:19 +0200
committerArthurHoaro <arthur@hoa.ro>2020-09-12 12:42:19 +0200
commitd52ab0b1e99aa0c494f389092dce1e926296032d (patch)
tree3a436eedf30cbb8f8b0943c5e5c3b88e49488b69 /application/container/ContainerBuilder.php
parente2dff28b44fafcf11a1db7985c50cd40e6945821 (diff)
downloadShaarli-d52ab0b1e99aa0c494f389092dce1e926296032d.tar.gz
Shaarli-d52ab0b1e99aa0c494f389092dce1e926296032d.tar.zst
Shaarli-d52ab0b1e99aa0c494f389092dce1e926296032d.zip
Properly handle 404 errors
Use 404 template instead of default Slim error page if the route is not found. Fixes #827
Diffstat (limited to 'application/container/ContainerBuilder.php')
-rw-r--r--application/container/ContainerBuilder.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/application/container/ContainerBuilder.php b/application/container/ContainerBuilder.php
index 58067c99..55bb51b5 100644
--- a/application/container/ContainerBuilder.php
+++ b/application/container/ContainerBuilder.php
@@ -10,6 +10,7 @@ use Shaarli\Config\ConfigManager;
10use Shaarli\Feed\FeedBuilder; 10use Shaarli\Feed\FeedBuilder;
11use Shaarli\Formatter\FormatterFactory; 11use Shaarli\Formatter\FormatterFactory;
12use Shaarli\Front\Controller\Visitor\ErrorController; 12use Shaarli\Front\Controller\Visitor\ErrorController;
13use Shaarli\Front\Controller\Visitor\ErrorNotFoundController;
13use Shaarli\History; 14use Shaarli\History;
14use Shaarli\Http\HttpAccess; 15use Shaarli\Http\HttpAccess;
15use Shaarli\Netscape\NetscapeBookmarkUtils; 16use Shaarli\Netscape\NetscapeBookmarkUtils;
@@ -149,6 +150,9 @@ class ContainerBuilder
149 ); 150 );
150 }; 151 };
151 152
153 $container['notFoundHandler'] = function (ShaarliContainer $container): ErrorNotFoundController {
154 return new ErrorNotFoundController($container);
155 };
152 $container['errorHandler'] = function (ShaarliContainer $container): ErrorController { 156 $container['errorHandler'] = function (ShaarliContainer $container): ErrorController {
153 return new ErrorController($container); 157 return new ErrorController($container);
154 }; 158 };