[Rt-devel] possible bug in 3.4.1

Stéphane Dalton sdalton at corecoimaging.com
Mon Apr 25 07:32:14 EDT 2005





Hi guys,

First, thanks for such a great product!

While using rt3 (3.4.1 on linux ) we discovered that when attaching large
(> 1mb) of text file to a ticket, RT3 became awfully slow to display it
because it was trying to display the entire content of the text instead of
only the download link. We also experimented the same behavior while
attaching images.

I read the RT_SiteConfig file and found the MaxInlineBody variable, but it
didn't seem to work... After playing with different scenarios, I made the
following modification to the code (beware I'm a super newbie Perl
programmer :)))

--- ShowTransactionAttachments  2005-02-01 09:20:40.000000000 -0500
+++ /opt/rt3/share/html/Ticket/Elements/ShowTransactionAttachments
2005-04-22 09:52:14.172707752 -0400
@@ -95,7 +95,7 @@

     # If it's text
     if (   $message->ContentType =~ m{^(text|message)}i
-        && $size <= $RT::MaxInlineBody )
+        && $message->ContentLength <= $RT::MaxInlineBody )
     {

         if (
@@ -151,7 +151,9 @@
     }

     # if it's an image, show it as an image
-    elsif ( $message->ContentType =~ /^image\//i ) {
+    elsif ( $message->ContentType =~ /^image\//i
+        && $message->ContentLength <= $RT::MaxInlineImage )
+    {
         $m->out('<img src="'
               . $AttachPath . '/'
               . $Transaction->Id . '/'

I took the liberty to add a MaxInlineImage variable to the RT_SiteConfig.pm
file. I'm convinced there are much nicer way to fix the problem but this
fix works for me.

>From my understanding of the code it seems that the $size variable is
messed up (converted from integer to text for the display of the download
size).

What do you think about this, am I wrong?



More information about the Rt-devel mailing list