Skip to content

Commit 086d0b9

Browse files
authored
Add 404 status handling in manual lookup and results pages (#1783)
1 parent 3d20b5a commit 086d0b9

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

manual-lookup.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515

1616
if (!empty($_GET['scope']) && is_string($_GET['scope'])) {
1717
$scope = htmlspecialchars($_GET['scope'], ENT_QUOTES, 'UTF-8');
18+
19+
if ($scope == '404quickref') {
20+
status_header(404);
21+
}
1822
} else {
1923
$scope = '';
2024
}

results.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
$_SERVER['BASE_PAGE'] = 'results.php';
44
include __DIR__ . '/include/prepend.inc';
55

6+
if (!empty($_GET['p']) && is_string($_GET['p'])) {
7+
$show = htmlspecialchars($_GET['p'], ENT_QUOTES, 'UTF-8');
8+
9+
if ($show == '404manual') {
10+
status_header(404);
11+
}
12+
}
13+
614
// HTTP status line is passed on, signifies an error
715
site_header(
816
'Search results',

0 commit comments

Comments
 (0)