From cdf55d6e6937a73ecc06f5bc0de3b33e751fc480 Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Mon, 2 Mar 2015 17:07:30 +0100 Subject: [PATCH] Quick 404 redirection --- index.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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