smart_build.php: additional fixes

This commit is contained in:
czaks 2015-04-02 20:35:17 +02:00
parent 67db118f1e
commit 018ec3b605

View File

@ -124,6 +124,7 @@ $entrypoints['/%b/catalog.html'] = 'sb_catalog';
$reached = false; $reached = false;
$request = $_SERVER['REQUEST_URI']; $request = $_SERVER['REQUEST_URI'];
list($request) = explode('?', $request);
foreach ($entrypoints as $id => $fun) { foreach ($entrypoints as $id => $fun) {
$id = '@^' . preg_quote($id, '@') . '$@u'; $id = '@^' . preg_quote($id, '@') . '$@u';
@ -145,13 +146,14 @@ foreach ($entrypoints as $id => $fun) {
function die_404() { global $config; function die_404() { global $config;
if (!$config['page_404']) { if (!$config['page_404']) {
header("HTTP/1.1 404 Not Exists"); header("HTTP/1.1 404 Not Found");
header("Status: 404 Not Exists"); header("Status: 404 Not Found");
echo "<h1>404 Not Exists</h1><p>Page doesn't exist<hr><address>vichan</address>"; echo "<h1>404 Not Found</h1><p>Page doesn't exist<hr><address>vichan</address>";
} }
else { else {
header("Location: ".$config['page_404']); header("Location: ".$config['page_404']);
} }
die(); die();
} }