BUGFIX : encoding problem & security problem
authorPaul POULAIN <paul.poulain@biblibre.com>
Thu, 10 Apr 2008 08:41:16 +0000 (10:41 +0200)
committerJoshua Ferraro <jmf@liblime.com>
Fri, 11 Apr 2008 21:56:24 +0000 (16:56 -0500)
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
tools/export.pl

index aee9e32..d90d7fc 100755 (executable)
@@ -32,10 +32,25 @@ my $filename=$query->param("filename");
 my $dbh=C4::Context->dbh;
 my $marcflavour = C4::Context->preference("marcflavour");
 
+my ($template, $loggedinuser, $cookie)
+    = get_template_and_user
+    (
+        {
+            template_name => "tools/export.tmpl",
+            query => $query,
+            type => "intranet",
+            authnotrequired => 0,
+            flagsrequired => {tools => 1},
+            debug => 1,
+            }
+    );
+
 if ($op eq "export") {
+    binmode(STDOUT,":utf8");
        print $query->header(   -type => 'application/octet-stream', 
-                                                       -attachment=>$filename);
-    
+                            -charset => 'utf-8',
+                            -attachment=>$filename);
+     
     my $StartingBiblionumber  = $query->param("StartingBiblionumber");
     my $EndingBiblionumber    = $query->param("EndingBiblionumber");
     my $output_format         = $query->param("output_format");
@@ -159,7 +174,6 @@ else {
             debug => 1,
          }
     );
-    
     $template->param(
         branchloop   => \@branchloop,
         itemtypeloop => \@itemtypesloop