Commit cdf55d6e6937a73ecc06f5bc0de3b33e751fc480

Authored by Geoffrey PREUD'HOMME
1 parent 3fe59fff

Quick 404 redirection

Doesn't do anything since we ne longer use mod_rewrite, but why not?
Showing 1 changed file with 3 additions and 2 deletions   Show diff stats
@@ -13,10 +13,11 @@ $page = str_replace('.', '', $page); // TODO Better sanitization @@ -13,10 +13,11 @@ $page = str_replace('.', '', $page); // TODO Better sanitization
13 if ($page == '') { 13 if ($page == '') {
14 $page = 'home'; 14 $page = 'home';
15 } 15 }
16 -  
17 $toLoad = "pages/$page.php"; 16 $toLoad = "pages/$page.php";
18 17
19 -// TODO Test if exists, 404 otherwise 18 +if (!file_exists($toLoad)) {
  19 + $toLoad = '404.php';
  20 +}
20 21
21 if (isset($_GET['c'])) { 22 if (isset($_GET['c'])) {
22 require_once("$toLoad"); 23 require_once("$toLoad");