]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/View.pm
view: note we assume UTF-8 on unknown encodings
[public-inbox.git] / lib / PublicInbox / View.pm
index 89174296335ab594cfac100db4d87664d506afc4..d897aeecc3ed3abf6ba2dc71bb9540cbf3ec0bdd 100644 (file)
@@ -518,7 +518,9 @@ sub attach_link ($$$$;$) {
        my $rv = $ctx->{obuf};
        $$rv .= qq($nl<a\nhref="$ctx->{mhref}$idx-$sfn">);
        if ($err) {
-               $$rv .= "[-- Warning: decoded text below may be mangled --]\n";
+               $$rv .= <<EOF;
+[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
+EOF
        }
        $$rv .= "[-- Attachment #$idx: ";
        my $ts = "Type: $ct, Size: $size bytes";
@@ -576,7 +578,7 @@ sub add_text_body { # callback for msg_iter
        $s .= "\n" unless $s =~ /\n\z/s;
 
        # split off quoted and unquoted blocks:
-       my @sections = split(/((?:^>[^\n]*\n)+)/sm, $s);
+       my @sections = PublicInbox::MsgIter::split_quotes($s);
        $s = '';
        my $rv = $ctx->{obuf};
        if (defined($fn) || $depth > 0 || $err) {
@@ -1056,7 +1058,7 @@ sub acc_topic { # walk_thread callback
 sub dump_topics {
        my ($ctx) = @_;
        my $order = delete $ctx->{order}; # [ ds, subj1, subj2, subj3, ... ]
-       if (!@$order) {
+       unless ($order) {
                $ctx->{-html_tip} = '<pre>[No topics in range]</pre>';
                return 404;
        }