Changeset 4224


Ignore:
Timestamp:
2003-05-05T12:07:08+12:00 (21 years ago)
Author:
jrm21
Message:

fixed regexp for when we have a content type without a charset

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/plugins/EMAILPlug.pm

    r4089 r4224  
    584584            $part_content_type="message/rfc822";
    585585        }
    586         if ($part_header =~ m@^content\-type:\s*([\w\.\-/]+)\s*\;?\s*(.*?)\s*$@mi) {
     586        if ($part_header =~ m@^content\-type:\s*([\w\.\-/]+)\s*(\;.*)?$@mi) {
    587587            $part_content_type=$1; $part_content_type =~ tr/A-Z/a-z/;
    588588            $part_content_info=$2;
     589            if (!defined($part_content_info)) {
     590            $part_content_info="";
     591            } else {
     592            $part_content_info =~ s/^\;\s*//;
     593            $part_content_info =~ s/\s*$//;
     594            }
    589595        }
    590596        my $filename="";
     
    626632            my $rfc822_formatted_body=""; # put result in here
    627633            if ($message_part_headers =~
    628             /^content\-type:\s*([\w\.\-\/]+)\s*\;?\s*(.*?)\s*$/ims)
     634            /^content\-type:\s*([\w\.\-\/]+)\s*(\;.*)?$/ims)
    629635            {
    630636            # The message header uses MIME flags
     
    633639            if (!defined($message_content_info)) {
    634640                $message_content_info="";
     641            } else {
     642                $message_content_info =~ s/^\;\s*//;
     643                $message_content_info =~ s/\s*$//;
    635644            }
    636645            $message_content_type =~ tr/A-Z/a-z/;
Note: See TracChangeset for help on using the changeset viewer.