[otrs-cvs] otrs/Kernel/Output/HTML Layout.pm,1.91,1.92

CVS commits notifications of OTRS.org cvs-log at otrs.org
Tue Apr 29 16:15:15 GMT 2008


Comments:
Update of /home/cvs/otrs/Kernel/Output/HTML
In directory lancelot:/tmp/cvs-serv14384/Kernel/Output/HTML

Modified Files:
	Layout.pm 
Log Message:
Fixed problem with UTF-8 characters in filenames in Attachment() function.

Author: mh

Index: Layout.pm
===================================================================
RCS file: /home/cvs/otrs/Kernel/Output/HTML/Layout.pm,v
retrieving revision 1.91
retrieving revision 1.92
diff -C2 -d -r1.91 -r1.92
*** Layout.pm	24 Apr 2008 21:37:28 -0000	1.91
--- Layout.pm	29 Apr 2008 16:15:10 -0000	1.92
***************
*** 2813,2828 ****
      }
  
-     # reset binmode, don't use utf8
-     binmode(STDOUT);
- 
-     # disable utf8 flag, to write binary to output
-     if ( $Self->{EncodeObject}->EncodeFrontendUsed() =~ /utf(8|-8)/i ) {
-         for my $Type ( qw(Content Filename ContentType) ) {
-             if ( defined $Param{ $Type } ) {
-                 $Self->{EncodeObject}->EncodeOutput( \$Param{ $Type } );
-             }
-         }
-     }
- 
      # return attachment
      my $Output = 'Content-Disposition: ';
--- 2813,2816 ----
***************
*** 2838,2845 ****
      # clean filename to get no problems with some browsers
      if ( $Param{Filename} ) {
-         $Param{Filename} = $Self->{MainObject}->FilenameCleanUp(
-             Filename => $Param{Filename},
-             Type     => 'Attachment',
-         );
          $Output .= " filename=\"$Param{Filename}\"";
      }
--- 2826,2829 ----
***************
*** 2862,2865 ****
--- 2846,2853 ----
      $Output .= "Content-Type: $Param{ContentType}\n\n";
  
+     # disable utf8 flag, to write binary to output
+     $Self->{EncodeObject}->EncodeOutput( \$Output );
+     $Self->{EncodeObject}->EncodeOutput( \$Param{Content} );
+ 
      # fix for firefox HEAD problem
      if ( !$ENV{REQUEST_METHOD} || $ENV{REQUEST_METHOD} ne 'HEAD' ) {
***************
*** 2872,2875 ****
--- 2860,2866 ----
      delete $Self->{FilterContent}->{ActiveElementFilter};
  
+     # reset binmode, don't use utf8
+     binmode(STDOUT);
+ 
      return $Output;
  }


More information about the cvs-log mailing list