Bugzilla – Attachment 191339 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
cc9197b.patch (text/plain), 1.47 KB, created by
Jonathan Druart
on 2026-01-13 09:14:30 UTC
(
hide
)
Description:
Bug 30803: Don't hardcode 404 into output_error
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2026-01-13 09:14:30 UTC
Size:
1.47 KB
patch
obsolete
>From cc9197b8289032e18280c99f8b6a53ed8de9d023 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 > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > 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 >
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