diff --git a/index.php b/index.php index e40ff5e..8e0e1de 100755 --- a/index.php +++ b/index.php @@ -13,10 +13,11 @@ $page = str_replace('.', '', $page); // TODO Better sanitization if ($page == '') { $page = 'home'; } - $toLoad = "pages/$page.php"; -// TODO Test if exists, 404 otherwise +if (!file_exists($toLoad)) { + $toLoad = '404.php'; +} if (isset($_GET['c'])) { require_once("$toLoad"); -- libgit2 0.21.2