[Rt-commit] r16975 - rt/3.8/trunk/share/html/Ticket
ruz at bestpractical.com
ruz at bestpractical.com
Fri Nov 21 20:32:06 EST 2008
Author: ruz
Date: Fri Nov 21 20:32:06 2008
New Revision: 16975
Modified:
rt/3.8/trunk/share/html/Ticket/Create.html
Log:
* file uploaded via web form may contain unicode characters
Modified: rt/3.8/trunk/share/html/Ticket/Create.html
==============================================================================
--- rt/3.8/trunk/share/html/Ticket/Create.html (original)
+++ rt/3.8/trunk/share/html/Ticket/Create.html Fri Nov 21 20:32:06 2008
@@ -350,19 +350,19 @@
if ($ARGS{'Attach'}) { # attachment?
$session{'Attachments'} = {} unless defined $session{'Attachments'};
- my $subject = "$ARGS{'Attach'}";
-
- # strip leading directories
- $subject =~ s#^.*[\\/]##;
+ my $file_path = Encode::decode_utf8("$ARGS{'Attach'}");
+ my ($file_name) = $file_path =~ m{([\\/]+)$};
my $attachment = MakeMIMEEntity(
- Subject => $subject,
+ Subject => $file_name,
Body => "",
AttachmentFieldName => 'Attach'
);
- $session{'Attachments'} = { %{$session{'Attachments'} || {}},
- $ARGS{'Attach'} => $attachment };
+ $session{'Attachments'} = {
+ %{$session{'Attachments'} || {}},
+ $file_path => $attachment,
+ };
}
# }}}
More information about the Rt-commit
mailing list