Skip Menu |

This queue is for tickets about the MIME-Lite CPAN distribution.

Report information
The Basics
Id: 50414
Status: new
Priority: 0/
Queue: MIME-Lite

People
Owner: Nobody in particular
Requestors: craig [...] constantine.name
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 3.026
Fixed in: (no value)



Subject: can't use string as HASH ref line 1690 in scrub()
I recently upgraded from 3.01_06 to 3.026, and now getting an error on line 1690 in scrub(). I have set the Type = 'text/plain' (for example). And in scrub() the lines: 1689 ### TBD: this is not really right for message/digest: 1690 if ( ( keys %{ $self->{Attrs}{'content-type'} } == 1 ) 1691 and ( $self->_safe_attr('content-type') eq 'text/plain' ) ) 1692 { don't work since $self->{Attrs}{'content-type'} would be a scalar. Does that need to be something like 1689 ### TBD: this is not really right for message/digest: 1690 if ( ( $self->{Attrs}{'content-type'}!~m/^HASH/ or keys %{ $self->{Attrs}{'content-type'} } == 1 ) 1691 and ( $self->_safe_attr('content-type') eq 'text/plain' ) ) 1692 { ?? -craig
From: craig [...] constantine.name
If anyone else falls over this, I worked around this by using scrub() and explicitly stating what headers to scrub. (The bug lies in how scrub() tests what it can scrub.) I only needed to scrub specific headers: $mime->scrub([ 'content-disposition', 'content-type' ]);