[web-doc] master: Fix typo in error message and improve database file existence check (#71)
| From: | Luffy via GitHub | Date: | Thu, 29 Oct 2026 17:15:14 +0000 |
| Subject: | [web-doc] master: Fix typo in error message and improve database file existence check (#71) | ||
| Groups: | php.doc.web | ||
| Request: | Send a blank email to doc-web+get-2561@lists.php.net to get a copy of this message | ||
Author: Luffy (sy-records)
Committer: GitHub (web-flow)
Pusher: jordikroon
Date: 2026-10-29T18:15:11+01:00
Commit: https://github.com/php/web-doc/commit/efd34802b452f40d3d99d8d7ead7d19213323c5c
Raw diff: https://github.com/php/web-doc/commit/efd34802b452f40d3d99d8d7ead7d19213323c5c.diff
Fix typo in error message and improve database file existence check (#71)
Changed paths:
M www/error.php
M www/revcheck.php
Diff:
diff --git a/www/error.php b/www/error.php
index 4ab5d04..16c2f7c 100644
--- a/www/error.php
+++ b/www/error.php
@@ -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();
diff --git a/www/revcheck.php b/www/revcheck.php
index 229297d..11db954 100644
--- a/www/revcheck.php
+++ b/www/revcheck.php
@@ -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;
@@ -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;