summaryrefslogtreecommitdiff
path: root/fml/lib/Mail/Message.pm
diff options
context:
space:
mode:
authorfukachan <fukachan>2003-06-20 22:29:33 +0000
committerfukachan <fukachan>2003-06-20 22:29:33 +0000
commit1d7fcbb73c77e421003725f2acda2fc0edafa828 (patch)
treea302d74fbb707dfa2c82afc0816161297eb23943 /fml/lib/Mail/Message.pm
parent71ab7912452eb5455277d16f1b3df627306607b5 (diff)
downloadfml8-1d7fcbb73c77e421003725f2acda2fc0edafa828.tar.gz
fml8-1d7fcbb73c77e421003725f2acda2fc0edafa828.tar.bz2
fml8-1d7fcbb73c77e421003725f2acda2fc0edafa828.zip
bug fixed: message_text() should be able to handle differenct type $data.
Diffstat (limited to 'fml/lib/Mail/Message.pm')
-rw-r--r--fml/lib/Mail/Message.pm15
1 files changed, 13 insertions, 2 deletions
diff --git a/fml/lib/Mail/Message.pm b/fml/lib/Mail/Message.pm
index 7cba2685..5cfebfe9 100644
--- a/fml/lib/Mail/Message.pm
+++ b/fml/lib/Mail/Message.pm
@@ -4,7 +4,7 @@
# All rights reserved. This program is free software; you can
# redistribute it and/or modify it under the same terms as Perl itself.
#
-# $FML: Message.pm,v 1.78 2003/05/01 14:00:57 fukachan Exp $
+# $FML: Message.pm,v 1.79 2003/05/09 13:54:44 fukachan Exp $
#
package Mail::Message;
@@ -2143,13 +2143,24 @@ sub message_text
# if the content is undef, do nothing.
return undef unless $data;
+ if (ref($data) eq 'FML::Header' || ref($data) eq 'Mail::Header') {
+ my $buf = $data->as_string();
+ $data = \$buf;
+ }
+
if ($base_data_type =~ /multipart/i) {
$pos_begin = $self->{ offset_begin };
$msglen = $self->{ offset_end } - $pos_begin;
}
else {
$pos_begin = 0;
- $msglen = length($$data);
+
+ if (ref($data) eq 'SCALAR') {
+ $msglen = length($$data);
+ }
+ else {
+ $msglen = -1;
+ }
}
if (defined $size) {