type => $type,
subtype => $subtype,
attributes => $attributes,
-
- # This is dumb. Really really dumb. For backcompat. -- rjbs,
- # 2013-08-10
- discrete => $type,
- composite => $subtype,
};
}
a hash as above, with entries for the C<type>, the C<subtype>, and a hash of
C<attributes>.
-For backward compatibility with a really unfortunate misunderstanding of RFC
-2045 by the early implementors of this module, C<discrete> and C<composite> are
-also present in the returned hashref, with the values of C<type> and C<subtype>
-respectively.
-
=func parse_content_disposition
This routine is exported by default.
my $ct = $part->content_type;
$ct = parse_content_type($ct) if $ct;
- # discrete == type, we remain Debian wheezy-compatible
- if ($ct && (($ct->{discrete} || '') eq 'text')) {
+ if ($ct && (($ct->{type} || '') eq 'text')) {
# display all text as text/plain:
my $cset = $ct->{attributes}->{charset};
if ($cset && ($cset =~ /\A[a-zA-Z0-9_\-]+\z/)) {
sub test {
my ($string, $expect, $info) = @_;
- # So stupid. -- rjbs, 2013-08-10
- $expect->{discrete} = $expect->{type};
- $expect->{composite} = $expect->{subtype};
-
local $_;
$info =~ s/\r/\\r/g;
$info =~ s/\n/\\n/g;