1 |
diff -Nur --no-dereference smeserver-ezmlm-www-2.0.0.old/root/opt/mailinglist/ezmlm-www.pl smeserver-ezmlm-www-2.0.0/root/opt/mailinglist/ezmlm-www.pl |
2 |
--- smeserver-ezmlm-www-2.0.0.old/root/opt/mailinglist/ezmlm-www.pl 2022-03-19 15:51:35.558000000 -0400 |
3 |
+++ smeserver-ezmlm-www-2.0.0/root/opt/mailinglist/ezmlm-www.pl 2022-03-19 16:07:38.596000000 -0400 |
4 |
@@ -165,7 +165,8 @@ |
5 |
|
6 |
for (@MessageIDs) { |
7 |
print "<li>"; |
8 |
- printf '<a href="?%s::%d">%s</a>', $WebRequest{ListID}, $_, Encode::decode( 'utf-8', $Messages{$_}->{subject} ); |
9 |
+ my $stri = ( Encode::is_utf8($Messages{$_}->{subject}) ) ? $Messages{$_}->{subject} : Encode::decode( 'utf-8', $Messages{$_}->{subject} ); |
10 |
+ printf '<a href="?%s::%d">%s</a>', $WebRequest{ListID}, $_, $stri; |
11 |
print " ($Messages{$_}->{author})"; |
12 |
print "</li>\n"; |
13 |
} |
14 |
@@ -179,7 +180,8 @@ |
15 |
my $thread_info = $WebRequest{List}->{archive}->getthread( $thread->{id} ); |
16 |
$thread->{date} =~ s/\s-\d{4}$//; |
17 |
print " <li>\n"; |
18 |
- printf " <b>%s</b> (%s)<br />\n", Encode::decode( 'utf-8', $thread_info->{subject} ), $thread->{date}; |
19 |
+ my $stri = ( Encode::is_utf8($thread_info->{subject} ) )? $thread_info->{subject} : Encode::decode( 'utf-8', $thread_info->{subject} ) ; |
20 |
+ printf " <b>%s</b> (%s)<br />\n", $stri , $thread->{date}; |
21 |
print " <ul class=\"messagelist\">\n"; |
22 |
foreach my $message ( @{$thread_info->{messages}} ) { |
23 |
next if $message->{month} ne $month; |
24 |
@@ -230,7 +232,7 @@ |
25 |
for (my $i=0; $i<=$#$parts; $i++) { |
26 |
my $part = $parts->[$i]; |
27 |
if ($part->{type} eq 'text/plain') { |
28 |
- $plaintext .= '<pre>' . Encode::decode( $charset, htmlencode(conceal($part->{body}, $WebRequest{List})) ) . '</pre>'; |
29 |
+ $plaintext .= ( ! Encode::is_utf8( htmlencode(conceal($part->{body}, $WebRequest{List})) ) ) ? '<pre>' . Encode::decode( $charset, htmlencode(conceal($part->{body}, $WebRequest{List})) ) . '</pre>' : '<pre>' . htmlencode(conceal($part->{body}, $WebRequest{List})). '</pre>'; |
30 |
} elsif ($part->{type} eq 'text/html') { |
31 |
if ($WebRequest{List}->{show_html}) { |
32 |
my $url = "?$WebRequest{ListID}::$WebRequest{MessageID}:get:$i"; |
33 |
@@ -238,7 +240,7 @@ |
34 |
$iframe .= 'marginheight="0" frameborder="0" vspace="0" hspace="0" '; |
35 |
$iframe .= 'style="overflow:visible;width:100%;display:none"></iframe>'; |
36 |
} else { |
37 |
- $rawhtml .= '<pre>' . Encode::decode( $charset, htmlencode(conceal($part->{body}, $WebRequest{List})) ) . '</pre>'; |
38 |
+ $rawhtml .= ( ! Encode::is_utf8(htmlencode(conceal($part->{body}, $WebRequest{List})) ) ) ? '<pre>' . Encode::decode( $charset, htmlencode(conceal($part->{body}, $WebRequest{List})) ) . '</pre>' : '<pre>' . htmlencode(conceal($part->{body}, $WebRequest{List})) . '</pre>'; |
39 |
} |
40 |
} elsif ($part->{type} !~ m,^(?:text/(?:plain|html|enriched)|application/applefile)$,) { |
41 |
$attachments{$i} = $part; |
42 |
@@ -722,4 +724,4 @@ |
43 |
return undef; |
44 |
} |
45 |
|
46 |
-1; |
47 |
\ Pas de fin de ligne à la fin du fichier |
48 |
+1; |