mirror of
https://github.com/vichan-devel/vichan.git
synced 2024-11-30 18:24:29 +01:00
Better "page not found" code
This commit is contained in:
parent
627c6ac91a
commit
4052d63502
6
mod.php
6
mod.php
@ -166,7 +166,9 @@
|
|||||||
if(!openBoard($boardName))
|
if(!openBoard($boardName))
|
||||||
error(ERROR_NOBOARD);
|
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['pages'] = getPages(true);
|
||||||
$page['mod'] = true;
|
$page['mod'] = true;
|
||||||
|
|
||||||
@ -204,7 +206,7 @@
|
|||||||
header('Location: ?/' . sprintf(BOARD_PATH, $boardName) . FILE_INDEX, true, REDIRECT_HTTP);
|
header('Location: ?/' . sprintf(BOARD_PATH, $boardName) . FILE_INDEX, true, REDIRECT_HTTP);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
error("Page not found.");
|
error(ERROR_404);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user