Skip to content

Commit

Permalink
Bug 7404: Bad regexp (and logic) in MS::PerMsgStatus::get_content_pre…
Browse files Browse the repository at this point in the history
…view

git-svn-id: https://svn.apache.org/repos/asf/spamassassin/trunk@1791010 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Mark Martinec committed Apr 11, 2017
1 parent 54b17bf commit edb00a8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/Mail/SpamAssassin/PerMsgStatus.pm
Original file line number Diff line number Diff line change
Expand Up @@ -896,16 +896,16 @@ sub get_content_preview {
$str .= shift @{$ary};
}
undef $ary;
chomp ($str); $str .= " [...]\n";

# in case the last line was huge, trim it back to around 200 chars
local $1;
$str =~ s/^(.{,200}).*$/$1/gs;
$str =~ s/^(.{200}).+$/$1 [...]/gm;
chomp ($str); $str .= "\n";

# now, some tidy-ups that make things look a bit prettier
$str =~ s/-----Original Message-----.*$//gs;
$str =~ s/-----Original Message-----.*$//gm;
$str =~ s/This is a multi-part message in MIME format\.//gs;
$str =~ s/[-_\*\.]{10,}//gs;
$str =~ s/[-_*.]{10,}//gs;
$str =~ s/\s+/ /gs;

# add "Content preview:" ourselves, so that the text aligns
Expand Down

0 comments on commit edb00a8

Please sign in to comment.