From a7ba1bb941f9b7ff42754711c4af21e2f25e2e53 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Tue, 13 May 2008 16:40:15 -0500 Subject: [PATCH] kohabug 2105: prevent crash on IE7 Three scripts were incorrect setting the HTTP type header to 'utf-8' instead of something appropriate like 'text/html' - Firefox evidentally can ignore that mistake, but IE7 does not. Fixed by replacing an invalid print of the HTTP header and template output with a call to C4::Output::output_html_with_http_headers. Also corrected POD in C4::Auth and InstallAuth to reflect correct use of output_html_with_http_headers. Signed-off-by: Joshua Ferraro --- C4/Auth.pm | 7 ++----- cataloguing/value_builder/unimarc_field_100.pl | 3 ++- installer/InstallAuth.pm | 7 ++----- members/mancredit.pl | 2 +- members/maninvoice.pl | 16 +++++----------- 5 files changed, 12 insertions(+), 23 deletions(-) diff --git a/C4/Auth.pm b/C4/Auth.pm index 0e976047d2..3951892e57 100755 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -58,6 +58,7 @@ C4::Auth - Authenticates Koha users use CGI; use C4::Auth; + use C4::Output; my $query = new CGI; @@ -72,11 +73,7 @@ C4::Auth - Authenticates Koha users } ); - print $query->header( - -type => 'utf-8', - -cookie => $cookie - ), $template->output; - + output_html_with_http_headers $query, $cookie, $template->output; =head1 DESCRIPTION diff --git a/cataloguing/value_builder/unimarc_field_100.pl b/cataloguing/value_builder/unimarc_field_100.pl index 5f8e36e853..e15943040d 100755 --- a/cataloguing/value_builder/unimarc_field_100.pl +++ b/cataloguing/value_builder/unimarc_field_100.pl @@ -23,6 +23,7 @@ use strict; use C4::Auth; use CGI; use C4::Context; +use C4::Output; =head1 @@ -122,7 +123,7 @@ sub plugin { "f14" => $f14, "f15$f15" => 1 ); - print $input->header( -type => 'utf-8', -cookie => $cookie ), $template->output; + output_html_with_http_headers $input, $cookie, $template->output; } 1; diff --git a/installer/InstallAuth.pm b/installer/InstallAuth.pm index fcc47fbbfa..73cb8149c7 100644 --- a/installer/InstallAuth.pm +++ b/installer/InstallAuth.pm @@ -42,6 +42,7 @@ InstallAuth - Authenticates Koha users for Install process use CGI; use InstallAuth; + use C4::Output; my $query = new CGI; @@ -53,11 +54,7 @@ InstallAuth - Authenticates Koha users for Install process flagsrequired => {borrow => 1}, }); - print $query->header( - -type => 'utf-8', - -cookie => $cookie - ), $template->output; - + output_html_with_http_headers $query, $cookie, $template->output; =head1 DESCRIPTION diff --git a/members/mancredit.pl b/members/mancredit.pl index d3d182d70b..714ce9111d 100755 --- a/members/mancredit.pl +++ b/members/mancredit.pl @@ -72,5 +72,5 @@ if ($add){ phone => $data->{'phone'}, email => $data->{'email'}, ); - print $input->header( -type => 'utf-8', -cookie => $cookie),$template->output; + output_html_with_http_headers $input, $cookie, $template->output; } diff --git a/members/maninvoice.pl b/members/maninvoice.pl index 18371aa344..f3ad4cbad3 100755 --- a/members/maninvoice.pl +++ b/members/maninvoice.pl @@ -55,10 +55,7 @@ if ($add){ $template->param('ITEMNUMBER' => 1); } $template->param('ERROR' => $error); - print $input->header( - -type => 'utf-8', - -cookie => $cookie - ),$template->output; + output_html_with_http_headers $input, $cookie, $template->output; } else { print $input->redirect("/cgi-bin/koha/members/boraccount.pl?borrowernumber=$borrowernumber"); @@ -75,9 +72,9 @@ if ($add){ debug => 1, }); -$template->param( adultborrower => 1 ) if ( $data->{'category_type'} eq 'A' ); -my ($picture, $dberror) = GetPatronImage($data->{'cardnumber'}); -$template->param( picture => 1 ) if $picture; + $template->param( adultborrower => 1 ) if ( $data->{'category_type'} eq 'A' ); + my ($picture, $dberror) = GetPatronImage($data->{'cardnumber'}); + $template->param( picture => 1 ) if $picture; $template->param( borrowernumber => $borrowernumber, @@ -94,8 +91,5 @@ $template->param( picture => 1 ) if $picture; phone => $data->{'phone'}, email => $data->{'email'}, ); - print $input->header( - -type => 'utf-8', - -cookie => $cookie - ),$template->output; + output_html_with_http_headers $input, $cookie, $template->output; } -- 2.20.1