Update of /cvsroot/popfile/engine/Classifier
In directory sc8-pr-cvs1:/tmp/cvs-serv2279
Modified Files:
MailParse.pm
Log Message:
fix decode_string to allow multiple encoded chunks without crashing
Index: MailParse.pm
===================================================================
RCS file: /cvsroot/popfile/engine/Classifier/MailParse.pm,v
retrieving revision 1.145
retrieving revision 1.146
diff -C2 -d -r1.145 -r1.146
*** MailParse.pm 12 Jul 2003 06:17:03 -0000 1.145
--- MailParse.pm 18 Jul 2003 05:08:56 -0000 1.146
***************
*** 477,481 ****
# If we hit a table tag then any font information is lost
!
if ( $tag =~ /^(table|td|tr|th)$/i ) {
$self->{htmlfontcolor__} = map_color( $self, 'black' );
--- 477,481 ----
# If we hit a table tag then any font information is lost
!
if ( $tag =~ /^(table|td|tr|th)$/i ) {
$self->{htmlfontcolor__} = map_color( $self, 'black' );
***************
*** 1296,1308 ****
my $decode_it = '';
! while ( $mystring =~ /=\?[\w-]+\?(B|Q)\?(.*)\?=/ig ) {
if ($1 eq "B") {
$decode_it = decode_base64( $2 );
! $mystring =~ s/=\?[\w-]+\?B\?(.*)\?=/$decode_it/i;
} elsif ($1 eq "Q") {
$decode_it = $2;
$decode_it =~ s/\_/=20/g;
$decode_it = decode_qp( $decode_it );
! $mystring =~ s/=\?[\w-]+\?Q\?(.*)\?=/$decode_it/i;
}
}
--- 1296,1309 ----
my $decode_it = '';
! while ( $mystring =~ /=\?[\w-]+\?(B|Q)\?(.*?)\?=/ig ) {
if ($1 eq "B") {
+ print $2;
$decode_it = decode_base64( $2 );
! $mystring =~ s/=\?[\w-]+\?B\?(.*?)\?=/$decode_it/i;
} elsif ($1 eq "Q") {
$decode_it = $2;
$decode_it =~ s/\_/=20/g;
$decode_it = decode_qp( $decode_it );
! $mystring =~ s/=\?[\w-]+\?Q\?(.*?)\?=/$decode_it/i;
}
}
|