[Rt-commit] r9961 - in rt/branches/3.6-RELEASE: . lib/t/regression
jesse at bestpractical.com
jesse at bestpractical.com
Sat Dec 15 02:11:15 EST 2007
Author: jesse
Date: Sat Dec 15 02:11:14 2007
New Revision: 9961
Modified:
rt/branches/3.6-RELEASE/ (props changed)
rt/branches/3.6-RELEASE/lib/RT/I18N.pm
rt/branches/3.6-RELEASE/lib/t/regression/06-mime_decoding.t
Log:
r72961 at pinglin: jesse | 2007-12-10 14:58:08 -0500
RT-Ticket: 8710
RT-Status: resolved
RT-Update correspond
* Attached patch fixes a bug in decoding content-type headers that contain encoded file names.
Modified: rt/branches/3.6-RELEASE/lib/RT/I18N.pm
==============================================================================
--- rt/branches/3.6-RELEASE/lib/RT/I18N.pm (original)
+++ rt/branches/3.6-RELEASE/lib/RT/I18N.pm Sat Dec 15 02:11:14 2007
@@ -303,7 +303,7 @@
my $str = shift;
my $enc = shift;
- @_ = $str =~ m/(.*?)=\?([^?]+)\?([QqBb])\?([^?]+)\?=([^=]*)/gc;
+ @_ = $str =~ m/(.*?)=\?([^?]+)\?([QqBb])\?([^?]+)\?=([^=]*)/gcs;
return ($str) unless (@_);
# add everything that hasn't matched to the end of the latest
Modified: rt/branches/3.6-RELEASE/lib/t/regression/06-mime_decoding.t
==============================================================================
--- rt/branches/3.6-RELEASE/lib/t/regression/06-mime_decoding.t (original)
+++ rt/branches/3.6-RELEASE/lib/t/regression/06-mime_decoding.t Sat Dec 15 02:11:14 2007
@@ -1,7 +1,7 @@
#!/usr/bin/perl
use strict;
use warnings;
-use Test::More tests => 6;
+use Test::More tests => 7;
use_ok("RT");
@@ -52,3 +52,13 @@
);
}
+diag q{newline and encoded file name} if $ENV{TEST_VERBOSE};
+{
+ my $str = qq{application/vnd.ms-powerpoint;\n\tname="=?ISO-8859-1?Q?Main_presentation.ppt?="};
+ is(
+ RT::I18N::DecodeMIMEWordsToUTF8($str),
+ qq{application/vnd.ms-powerpoint;\tname="Main presentation.ppt"},
+ "right decoding"
+ );
+}
+
More information about the Rt-commit
mailing list