diff options
| author | Savetheinternet <savetheinternet@n0v4.com> | 2010-12-16 23:09:44 +1100 |
|---|---|---|
| committer | Savetheinternet <savetheinternet@n0v4.com> | 2010-12-16 23:09:44 +1100 |
| commit | 4052d6350214e5384cfe15823e29197d2eaf7326 (patch) | |
| tree | 755a41807cf6a3fd1275749ca53a3a86b53be1ea /mod.php | |
| parent | 627c6ac91a338cfbd9fcc618b28dd678902da8f7 (diff) | |
Better "page not found" code
Diffstat (limited to 'mod.php')
| -rw-r--r-- | mod.php | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -166,7 +166,9 @@ if(!openBoard($boardName)) error(ERROR_NOBOARD); - $page = index(empty($matches[2]) || $matches[2] == FILE_INDEX ? 1 : $matches[2], true); + if(!$page = index(empty($matches[2]) || $matches[2] == FILE_INDEX ? 1 : $matches[2], true)) { + error(ERROR_404); + } $page['pages'] = getPages(true); $page['mod'] = true; @@ -204,7 +206,7 @@ header('Location: ?/' . sprintf(BOARD_PATH, $boardName) . FILE_INDEX, true, REDIRECT_HTTP); } else { - error("Page not found."); + error(ERROR_404); } } |
