1
0
mirror of https://github.com/php/web-php.git synced 2026-03-23 23:02:13 +01:00

Add 404 status handling in manual lookup and results pages (#1783)

This commit is contained in:
Luffy
2026-02-04 10:52:17 +08:00
committed by GitHub
parent 3d20b5a983
commit 086d0b9070
2 changed files with 12 additions and 0 deletions

View File

@@ -15,6 +15,10 @@ if (!empty($_GET['function']) && is_string($_GET['function'])) {
if (!empty($_GET['scope']) && is_string($_GET['scope'])) {
$scope = htmlspecialchars($_GET['scope'], ENT_QUOTES, 'UTF-8');
if ($scope == '404quickref') {
status_header(404);
}
} else {
$scope = '';
}

View File

@@ -3,6 +3,14 @@
$_SERVER['BASE_PAGE'] = 'results.php';
include __DIR__ . '/include/prepend.inc';
if (!empty($_GET['p']) && is_string($_GET['p'])) {
$show = htmlspecialchars($_GET['p'], ENT_QUOTES, 'UTF-8');
if ($show == '404manual') {
status_header(404);
}
}
// HTTP status line is passed on, signifies an error
site_header(
'Search results',