Bugzilla – Attachment 92218 Details for
Bug 23329
tracklinks.pl accepts any url from a parameter for proxying if not tracking
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23329: Move error page to its own subroutine
Bug-23329-Move-error-page-to-its-own-subroutine.patch (text/plain), 2.50 KB, created by
Martin Renvoize (ashimema)
on 2019-08-15 07:57:56 UTC
(
hide
)
Description:
Bug 23329: Move error page to its own subroutine
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-08-15 07:57:56 UTC
Size:
2.50 KB
patch
obsolete
>From e5beeaf77f05dbbaa62f9e730cd6f8781f9603fa Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 14 Aug 2019 14:56:46 -0400 >Subject: [PATCH] Bug 23329: Move error page to its own subroutine > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > C4/Output.pm | 21 ++++++++++++++++++++- > errors/404.pl | 18 +----------------- > 2 files changed, 21 insertions(+), 18 deletions(-) > >diff --git a/C4/Output.pm b/C4/Output.pm >index b107e27606..f8f8e13583 100644 >--- a/C4/Output.pm >+++ b/C4/Output.pm >@@ -31,6 +31,7 @@ use strict; > use URI::Escape; > use Scalar::Util qw( looks_like_number ); > >+use C4::Auth qw(get_template_and_user); > use C4::Context; > use C4::Templates; > >@@ -51,7 +52,7 @@ BEGIN { > ); > push @EXPORT, qw( > &output_html_with_http_headers &output_ajax_with_http_headers &output_with_http_headers >- &output_and_exit_if_error &output_and_exit >+ &output_and_exit_if_error &output_and_exit &output_error > ); > > } >@@ -365,6 +366,24 @@ sub output_and_exit { > exit; > } > >+sub output_error { >+ my ( $query, $error ) = @_; >+ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( >+ { >+ template_name => 'errors/errorpage.tt', >+ query => $query, >+ type => 'intranet', >+ authnotrequired => 1, >+ } >+ ); >+ my $admin = C4::Context->preference('KohaAdminEmailAddress'); >+ $template->param ( >+ admin => $admin, >+ errno => $error, >+ ); >+ output_with_http_headers $query, $cookie, $template->output, 'html', '404 Not Found'; >+} >+ > sub parametrized_url { > my $url = shift || ''; # ie page.pl?ln={LANG} > my $vars = shift || {}; # ie { LANG => en } >diff --git a/errors/404.pl b/errors/404.pl >index e5870ad83f..6d57df9352 100755 >--- a/errors/404.pl >+++ b/errors/404.pl >@@ -18,23 +18,7 @@ > > use Modern::Perl; > use CGI qw ( -utf8 ); >-use C4::Auth; > use C4::Output; >-use C4::Context; > > my $query = CGI->new; >-my $admin = C4::Context->preference('KohaAdminEmailAddress'); >-my ( $template, $loggedinuser, $cookie ) = get_template_and_user( >- { >- template_name => 'errors/errorpage.tt', >- query => $query, >- type => 'intranet', >- authnotrequired => 1, >- debug => 1, >- } >-); >-$template->param ( >- admin => $admin, >- errno => 404, >-); >-output_with_http_headers $query, $cookie, $template->output, 'html', '404 Not Found'; >+output_error( $query, '404' ); >-- >2.20.1
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 23329
:
91566
|
91572
|
91573
|
91759
|
91760
|
92109
|
92110
|
92111
|
92112
|
92187
|
92188
|
92198
|
92199
|
92200
|
92212
|
92213
|
92214
|
92215
|
92216
|
92217
|
92218
|
92219
|
92220
|
92223
|
92224
|
92225
|
92226
|
92227
|
92228
|
92229
|
92230
|
92231
|
92262
|
92263
|
92264
|
92265
|
92266
|
92267
|
92268
|
92269