[fsck.com #3399] Re: [rt-devel] [PATCH] Wrong detection of multipart.

Jesse Vincent jesse at bestpractical.com
Mon Aug 25 14:40:33 EDT 2003



On Mon, Aug 25, 2003 at 08:02:48PM +0400, Ruslan U. Zakirov wrote:
>        Hello.
> According to MIME-Tools documentation, citation:
> "As a special case, |message/*| is currently ambiguous: depending on the 
> parser, a |message/*| might be treated as a singlepart, with a 
> MIME::Body and no parts. Use bodyhandle() as the final arbiter."
> But in Attachment_Overlay.pm RT uses parts() call and then die on 
> ->bodyhandle()->as_string() call.

This patch looks incredibly suspect to me. Do you have an example
testcase that shows how the current behavior is flawed that we can add
to the test suite?

> Attached patch fix it.
>                Good luck. Ruslan.

> --- rt3_b/lib/RT/Attachment_Overlay.pm	2003-07-31 12:14:40.000000000 +0400
> +++ rt3/lib/RT/Attachment_Overlay.pm	2003-08-25 19:42:21.000000000 +0400
> @@ -133,7 +133,7 @@
>  	    =~ /^.*\bfilename="(.*)"$/ ? $1 : ''
>      };
>  
> -    if ( $Attachment->parts ) {
> +    if (not defined $Attachment->bodyhandle ) {
>          $id = $self->SUPER::Create(
>              TransactionId => $args{'TransactionId'},
>              Parent        => 0,


-- 
http://www.bestpractical.com/rt  -- Trouble Ticketing. Free.



More information about the Rt-devel mailing list