Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions www/error.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

require_once __DIR__ . '/../include/init.inc.php';

site_header();
site_header(['http_response_code' => 404]);

echo '<h2>Error 404</h2>';
if ($_SERVER['REDIRECT_STATUS'] == 404) {
echo '<p>File not found: '.htmlspecialchars($_SERVER['REQUEST_URI']).'</p>';
}
else {
echo '<p>An error occured</p>';
echo '<p>An error occurred</p>';
}

site_footer();
12 changes: 9 additions & 3 deletions www/revcheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,23 @@
}

if (!defined('SQLITE_DIR')) {
site_header();
site_header(['http_response_code' => 500]);
echo "<p>Unable to find SQLite database with revisions.</p>";
site_footer();
die;
}

$DBLANG = SQLITE_DIR . 'status.sqlite';
if (!file_exists($DBLANG)) {
site_header(['http_response_code' => 500]);
echo "<p>Database file doesn't exist</p>";
site_footer();
die;
}

$dbhandle = new SQLite3($DBLANG);
if (!$dbhandle) {
site_header();
site_header(['http_response_code' => 500]);
echo "<p>Database connection couldn't be established</p>";
site_footer();
die;
Expand All @@ -45,7 +51,7 @@
$lang_intro = get_language_intro($dbhandle, $lang);

if ($lang !== 'en' && is_null($lang_intro)) {
site_header();
site_header(['http_response_code' => 404]);
echo "<p>This revision check doesn't exist yet.</p>";
site_footer();
die;
Expand Down