Bugzilla – Attachment 191332 Details for
Bug 30803
output_error should not assume a 404 status
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30803: Don't hardcode 404 into output_error
Bug-30803-Dont-hardcode-404-into-outputerror.patch (text/plain), 1.40 KB, created by
David Cook
on 2026-01-13 02:01:06 UTC
(
hide
)
Description:
Bug 30803: Don't hardcode 404 into output_error
Filename:
MIME Type:
Creator:
David Cook
Created:
2026-01-13 02:01:06 UTC
Size:
1.40 KB
patch
obsolete
>From 2185d7f9d1f764bd65f64c6bdf8c885f98784c35 Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >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 >--- > 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.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 30803
:
191332
|
191339
|
191340
|
191341