Bug 10074 - Encoding problems at login time
authorTomas Cohen Arazi <tomascohen@gmail.com>
Thu, 18 Apr 2013 18:07:40 +0000 (15:07 -0300)
committerJared Camins-Esakov <jcamins@cpbibliography.com>
Sat, 20 Apr 2013 03:07:01 +0000 (23:07 -0400)
Bug 6554 patched output_html_with_http_headers to encode utf8 data, and Templates.pm to expect utf8 data to be encoded.
(At least) the staff login screen outputs directly to STDOUT (Auth.pm does, WHICH IS WRONG!) and wasn't fixed to do the encoding first.

This patch makes it use output_html_with_http_headers and solves the problem.

Changed 'use' for 'require' as jcamins and marcelr suggested.

Regards
To+

Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
C4/Auth.pm

index ca061b5..811151b 100644 (file)
@@ -19,6 +19,7 @@ package C4::Auth;
 
 use strict;
 use warnings;
+
 use Digest::MD5 qw(md5_base64);
 use Storable qw(thaw freeze);
 use URI::Escape;
@@ -1065,14 +1066,10 @@ sub checkauth {
         LibraryName => C4::Context->preference("LibraryName"),
     );
     $template->param( %info );
-#    $cookie = $query->cookie(CGISESSID => $session->id
-#   );
-    print $query->header(
-        -type   => 'text/html',
-        -charset => 'utf-8',
-        -cookie => $cookie
-      ),
-      $template->output;
+
+    require C4::Output;
+    C4::Output::output_html_with_http_headers( $query, $cookie,
+                                               $template->output);
     safe_exit;
 }