Changeset 2681 for trunk/gsdl/perllib/plugins/EMAILPlug.pm
- Timestamp:
- 2001-07-31T15:14:42+12:00 (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/plugins/EMAILPlug.pm
r2680 r2681 327 327 # RFC says boundary is <70 chars, [A-Za-z'()+_,-./:=?], so escape any 328 328 # that perl might want to interpolate. Also allows spaces... 329 330 329 $boundary=~s/\\/\\\\/g; 331 330 $boundary=~s/([\?\+\.\(\)\:\/\'])/\\$1/g; 332 my @message_parts = split("\r?\n\-\-$boundary", $text);331 my @message_parts = split("\r?\n\-\-$boundary", "\n$text"); 333 332 # remove first "part" and last "part" (final --) 334 333 shift @message_parts; … … 382 381 my $part_header=$message_part; 383 382 my $part_body; 384 if ($part_header=~s/\r?\n\r?\n(.*)$//sg) { 385 $part_body=$1; 386 } else { 383 if ($message_part=~ /^\s*\n/) { 387 384 # no header... use defaults 388 385 $part_body=$message_part; 389 386 $part_header="Content-type: text/plain; charset=us-ascii"; 390 } 387 } elsif ($part_header=~s/\r?\n\r?\n(.*)$//sg) { 388 $part_body=$1; 389 } else { 390 # something's gone wrong... 391 $part_header=""; 392 $part_body=$message_part; 393 } 394 391 395 $part_header =~ s/\r?\n[\t\ ]+/ /gs; #unfold 392 396 my $part_content_type=""; … … 506 510 my $text=shift; 507 511 my $part_header=$text; 508 $part_header =~ s/\r?\n\r?\n(.*)$//s; 509 $text=$1; if (!defined($text)) {$text="";} 512 # check for empty part header (leading blank line) 513 if ($text =~ /^\s*\r?\n/) { 514 $part_header="Content-type: text/plain; charset=us-ascii"; 515 } else { 516 $part_header =~ s/\r?\n\r?\n(.*)$//s; 517 $text=$1; if (!defined($text)) {$text="";} 518 } 510 519 $part_header =~ s/\r?\n[\t ]+/ /gs; #unfold 511 520 $part_header =~ /content\-type:\s*([\w\/]+)/is;
Note:
See TracChangeset
for help on using the changeset viewer.