From cc9197b8289032e18280c99f8b6a53ed8de9d023 Mon Sep 17 00:00:00 2001 From: David Cook Date: Tue, 13 Jan 2026 01:57:04 +0000 Subject: [PATCH] Bug 30803: Don't hardcode 404 into output_error This patch removes the hardcoded "404 Not Found" status code and reason phrase from output_error and instead uses just the code passed into the function. Test Plan: 0. Apply patch and koha-plack --restart kohadev 1. Go to http://localhost:8080/cgi-bin/koha/tracklinks.pl?uri=https%3A%2F%2Ftest.com&biblionumber=29 2. Note normal OPAC 404 error Bonus points: 1. Change 404 to 403 in the first output_error in opac/tracklinks.pl 2. koha-plack --restart kohadev 3. Go to http://localhost:8080/cgi-bin/koha/tracklinks.pl?uri=https%3A%2F%2Ftest.com&biblionumber=29 4. Note normal OPAC 403 error Signed-off-by: Jonathan Druart --- C4/Output.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/C4/Output.pm b/C4/Output.pm index 669b3e6b577..e7d968cf050 100644 --- a/C4/Output.pm +++ b/C4/Output.pm @@ -405,7 +405,9 @@ sub output_error { admin => $admin, errno => $error, ); - output_with_http_headers $query, $cookie, $template->output, 'html', '404 Not Found'; + + #NOTE: Technically, it is enough to just include the status code. You don't have to include the reason phrase. + output_with_http_headers $query, $cookie, $template->output, 'html', $error; } =item parametrized_url -- 2.43.0