[PHP-WEBMASTER] [web-php] master: Add 404 status handling in manual lookup and results pages (#1783)

Author: Luffy (sy-records)
Committer: GitHub (web-flow)
Pusher: sy-records
Date: 2026-02-04T10:52:17+08:00

Commit: Add 404 status handling in manual lookup and results pages (#1783) · php/web-php@086d0b9 · GitHub
Raw diff: https://github.com/php/web-php/commit/086d0b907003e0f2394228f77b46a2ec701b52b3.diff

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

Changed paths:
  M manual-lookup.php
  M results.php

Diff:

diff --git a/manual-lookup.php b/manual-lookup.php
index 855267ba23..78b0eed38f 100644
--- a/manual-lookup.php
+++ b/manual-lookup.php
@@ -15,6 +15,10 @@

if (!empty($_GET['scope']) && is_string($_GET['scope'])) {
     $scope = htmlspecialchars($_GET['scope'], ENT_QUOTES, 'UTF-8');
+
+ if ($scope == '404quickref') {
+ status_header(404);
+ }
} else {
     $scope = '';
}
diff --git a/results.php b/results.php
index a13f1d28b6..6cde699a26 100644
--- a/results.php
+++ b/results.php
@@ -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',