[rt-users] Bug: Mails with Attachements

Phil Homewood pdh at snapgear.com
Thu Sep 12 20:43:58 EDT 2002


Nils Ketelsen wrote:
> When I send an E-Mail with Attachement to my RT and the Filename of the
> Attachement contains a whitespace this whitespace is not encoded in the
> link showing up in the Ticket.
>
> Otherwise you will just receive an Errormessage from the Webserver. I guess
> it will be the same with Special-Characters in the filename. I guess its a
> bug, but it might as well be a local problem of my own.

Confirmed bug. Most browsers seem to compensate, it seems.

The attached hack will work around it for spaces only; feel free
to improve it to deal with any other special chars. (Something
like URI::Escape might be the way to go...)
-- 
Phil Homewood, Systems Janitor, www.SnapGear.com
pdh at snapgear.com Ph: +61 7 3435 2810 Fx: +61 7 3891 3630
SnapGear - Custom Embedded Solutions and Security Appliances
-------------- next part --------------
Index: ShowTransaction
===================================================================
RCS file: /cvs/local/rt/webrt/Ticket/Elements/ShowTransaction,v
retrieving revision 1.1.1.4
diff -u -r1.1.1.4 ShowTransaction
--- ShowTransaction	15 Jul 2002 01:25:48 -0000	1.1.1.4
+++ ShowTransaction	13 Sep 2002 00:17:43 -0000
@@ -66,6 +66,7 @@
 % }
 <%PERL>
 my $size = length($message->Content());
+my $fname = $message->Filename;
 
 if ($size) {
     if ($size > 1024) {
@@ -74,8 +75,9 @@
     else {
 	$size = $size ."b";
     }
+$fname =~ s/ /%20/g;
 </%PERL>
-<font size=-1><A HREF="Attachment/<%$Transaction->Id%>/<%$message->Id%>/<%$message->Filename%>">Download <%$message->Filename|| '(untitled)'%></a> <% $size %></font>
+<font size=-1><A HREF="Attachment/<%$Transaction->Id%>/<%$message->Id%>/<%$fname%>">Download <%$message->Filename|| '(untitled)'%></a> <% $size %></font>
 % }
 </TD>
 </TR>


More information about the rt-users mailing list