[Koha-patches] [PATCH] kohabug 2105: prevent crash on IE7
Galen Charlton
galen.charlton at liblime.com
Tue May 13 23:40:15 CEST 2008
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.
---
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 0e97604..3951892 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 5f8e36e..e159430 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 fcc47fb..73cb814 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 d3d182d..714ce91 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 18371aa..f3ad4cb 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;
}
--
1.5.5.rc0.16.g02b00
More information about the Koha-patches
mailing list