summaryrefslogtreecommitdiff
path: root/fml
diff options
context:
space:
mode:
authortmu <tmu>2006-06-15 10:35:24 +0000
committertmu <tmu>2006-06-15 10:35:24 +0000
commitfa9c29613b6839f673cf1649fe9d03b065021fc6 (patch)
treec90a8d82c97aeb45cb2b4f43e25d9e90ab1066de /fml
parent0d032bd3ab90b6189b809401906d4f6341f5de2d (diff)
downloadfml8-fa9c29613b6839f673cf1649fe9d03b065021fc6.tar.gz
fml8-fa9c29613b6839f673cf1649fe9d03b065021fc6.tar.bz2
fml8-fa9c29613b6839f673cf1649fe9d03b065021fc6.zip
change default @indexs
safety htmlify if broken mail header
Diffstat (limited to 'fml')
-rw-r--r--fml/lib/Mail/Message/ToHTML.pm43
1 files changed, 28 insertions, 15 deletions
diff --git a/fml/lib/Mail/Message/ToHTML.pm b/fml/lib/Mail/Message/ToHTML.pm
index 9491546e..2f04c6d5 100644
--- a/fml/lib/Mail/Message/ToHTML.pm
+++ b/fml/lib/Mail/Message/ToHTML.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: ToHTML.pm,v 1.83 2006/04/16 06:34:54 fukachan Exp $
+# $FML: ToHTML.pm,v 1.84 2006/05/22 14:24:51 tmu Exp $
#
package Mail::Message::ToHTML;
@@ -17,7 +17,7 @@ my $debug = 0;
my $URL =
"<A HREF=\"http://www.fml.org/software/\">Mail::Message::ToHTML</A>";
-my $version = q$FML: ToHTML.pm,v 1.83 2006/04/16 06:34:54 fukachan Exp $;
+my $version = q$FML: ToHTML.pm,v 1.84 2006/05/22 14:24:51 tmu Exp $;
my $versionid = 0;
if ($version =~ /,v\s+([\d\.]+)\s+/) {
$versionid = "$1";
@@ -178,6 +178,19 @@ sub htmlify_rfc822_message
my ($id, $src, $dst) = $self->_init_htmlify_rfc822_message($args);
$self->{ _debug_id } = $id;
+ # save information for index.html and thread.html
+ $self->cache_message_info($msg, { id => $id,
+ src => $src,
+ dst => $dst,
+ } );
+
+ # target html not define
+ unless ($dst) {
+ $self->{ _ignore_list }->{ $id } = 1; # ignore flag
+ warn("html file for $id not define") if $debug;
+ return undef;
+ }
+
# target html exists already.
if (-f $dst) {
$self->{ _ignore_list }->{ $id } = 1; # ignore flag
@@ -185,12 +198,6 @@ sub htmlify_rfc822_message
return undef;
}
- # save information for index.html and thread.html
- $self->cache_message_info($msg, { id => $id,
- src => $src,
- dst => $dst,
- } );
-
# prepare output channel
my $wh = $self->_set_output_channel( { dst => $dst } );
unless (defined $wh) {
@@ -325,6 +332,7 @@ sub htmlify_rfc822_message
$self->mhl_separator($wh);
$self->mhl_footer($wh);
$self->html_end($wh);
+ return 1;
}
@@ -435,6 +443,7 @@ sub html_filepath
if (defined($id) && ($id > 0)) {
my $filename = $self->html_filename($id);
+ return undef unless($filename);
use File::Spec;
return File::Spec->catfile($html_base_dir, $filename);
@@ -781,7 +790,8 @@ sub _format_safe_header
}
-my @indexs = qw(all thread month month_thread top);
+# create index.html type (all thread month month_thread top)
+my @indexs = qw(month month_thread top);
# Descriptions: show link to indexes as navigation
# Arguments: HASH_REF($args)
@@ -1573,9 +1583,9 @@ sub _update_id_montly_index_master
else {
_print_raw_str($wh, "<td>", $code);
}
- _print_raw_str($wh, "</td>", $code);
+ _print_raw_str($wh, "</td>\n", $code);
}
- _print_raw_str($wh, "</tr>", $code);
+ _print_raw_str($wh, "</tr>\n", $code);
}
_print_raw_str($wh, "</table>", $code);
@@ -1882,9 +1892,9 @@ sub _update_montly_thread_index_master
else {
_print_raw_str($wh, "<td>", $code);
}
- _print_raw_str($wh, "</td>", $code);
+ _print_raw_str($wh, "</td>\n", $code);
}
- _print_raw_str($wh, "</tr>", $code);
+ _print_raw_str($wh, "</tr>\n", $code);
}
_print_raw_str($wh, "</table>", $code);
@@ -2345,10 +2355,13 @@ sub htmlify_file
}
_PRINT_DEBUG("htmlify_rfc822_message begin");
- $html->htmlify_rfc822_message({
+ unless ($html->htmlify_rfc822_message({
id => $id,
src => $file,
- });
+ }) ) {
+ _PRINT_DEBUG("htmlify_rfc822_message end no change");
+ return;
+ }
_PRINT_DEBUG("htmlify_rfc822_message end");
if ($debug) {