removing guessencoding, hard-coding utf-8
authortipaul <tipaul>
Tue, 5 Jun 2007 08:53:19 +0000 (08:53 +0000)
committertipaul <tipaul>
Tue, 5 Jun 2007 08:53:19 +0000 (08:53 +0000)
C4/Auth.pm
C4/Auth_with_ldap.pm
C4/Output.pm
installer/InstallAuth.pm

index c4baf09..23f7e08 100644 (file)
@@ -60,7 +60,7 @@ C4::Auth - Authenticates Koha users
                          });
 
   print $query->header(
-    -type => guesstype($template->output),
+    -type => 'utf-8',
     -cookie => $cookie
   ), $template->output;
 
@@ -659,7 +659,7 @@ sub checkauth {
         -expires => ''
     );
     print $query->header(
-        -type   => guesstype( $template->output ),
+        -type   => 'utf-8',
         -cookie => $cookie
       ),
       $template->output;
index 61db824..0d113a4 100644 (file)
@@ -57,7 +57,7 @@ C4::Auth - Authenticates Koha users
                          });
 
   print $query->header(
-    -type => guesstype($template->output),
+    -type => 'utf-8',
     -cookie => $cookie
   ), $template->output;
 
@@ -548,7 +548,7 @@ sub checkauth {
         -expires => ''
     );
     print $query->header(
-        -type   => guesstype( $template->output ),
+        -type   => 'utf-8',
         -cookie => $cookie
       ),
       $template->output;
index b9279e1..46e48ee 100644 (file)
@@ -54,10 +54,8 @@ push @EXPORT, qw(
 
 #Output
 push @EXPORT, qw(
-               &guesscharset
-               &guesstype
-               &output_html_with_http_headers
-               );
+                &output_html_with_http_headers
+                );
 
 
 #FIXME: this is a quick fix to stop rc1 installing broken
@@ -315,42 +313,6 @@ sub pagination_bar {
     return $pagination_bar;
 }
 
-
-=item guesscharset
-
-   &guesscharset($output)
-
-"Guesses" the charset from the some HTML that would be output.
-
-C<$output> is the HTML page to be output. If it contains a META tag
-with a Content-Type, the tag will be scanned for a language code.
-This code is returned if it is found; undef is returned otherwise.
-
-This function only does sloppy guessing; it will be confused by
-unexpected things like SGML comments. What it basically does is to
-grab something that looks like a META tag and scan it.
-
-=cut
-
-sub guesscharset ($) {
-    my($html) = @_;
-    my $charset = undef;
-    local($`, $&, $', $1, $2, $3);
-    # FIXME... These regular expressions will miss a lot of valid tags!
-    if ($html =~ /<meta\s+http-equiv=(["']?)Content-Type\1\s+content=(["'])text\/html\s*;\s*charset=([^\2\s\r\n]+)\2\s*(?:\/?)>/is) {
-        $charset = $3;
-    } elsif ($html =~ /<meta\s+content=(["'])text\/html\s*;\s*charset=([^\1\s\r\n]+)\1\s+http-equiv=(["']?)Content-Type\3\s*(?:\/?)>/is) {
-        $charset = $2;
-    }
-    return $charset;
-} # guess
-
-sub guesstype ($) {
-    my($html) = @_;
-    my $charset = guesscharset($html);
-    return defined $charset? "text/html; charset=$charset": "text/html";
-}
-
 =item output_html_with_http_headers
 
    &output_html_with_http_headers($query, $cookie, $html)
@@ -364,7 +326,7 @@ corresponds to the HTML page $html.
 sub output_html_with_http_headers ($$$) {
     my($query, $cookie, $html) = @_;
     print $query->header(
-       -type   => guesstype($html),
+       -type   => 'utf-8',
        -cookie => $cookie,
     ), $html;
 }
index 71d46ee..2086856 100644 (file)
@@ -55,7 +55,7 @@ InstallAuth - Authenticates Koha users for Install process
                          });
 
   print $query->header(
-    -type => guesstype($template->output),
+    -type => 'utf-8',
     -cookie => $cookie
   ), $template->output;
 
@@ -373,7 +373,7 @@ sub checkauth {
         -expires => ''
     );
     print $query->header(
-        -type   => guesstype( $template->output ),
+        -type   => 'utf-8',
         -cookie => $cookie
       ),
       $template->output;