Changeset 2779


Ignore:
Timestamp:
2001-10-04T11:41:16+12:00 (23 years ago)
Author:
jrm21
Message:

Be a little more flexible when looking for boundary field in a content-type
header field, as there may be extra stuff in there.

File:
1 edited

Legend:

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

    r2754 r2779  
    132132    $Headers =~ s/\r?\n\r?\n(.*)$//s;
    133133    $$textref = $1;
     134   
     135    # See if headers include non-ascii - RFC says whole header should be ascii.
     136# not yet implemented, as we don't know what character set is the
     137# user's default... We can do textcat to guess, or we can just choose
     138# one of the charset fields later in the document (if there are any...)
     139#    if ($Headers =~ /([[:^ascii:]])/) {
     140#    }
    134141
    135142    # Unfold headers - see rfc822
     
    465472            $part_content_type="message/rfc822";
    466473        }
    467         if ($part_header =~ m@^content\-type:\s*([\w+/\-]+)\s*\;?\s*([^\s]*)@mi) {
     474        if ($part_header =~ m@^content\-type:\s*([\w+/\-]+)\s*\;?\s*(.*?)\s*@mi) {
    468475            $part_content_type=$1; $part_content_type =~ tr/A-Z/a-z/;
    469476            $part_content_info=$2;
     
    508515            my $rfc822_formatted_body=""; # put result in here
    509516            if ($message_part_headers =~
    510             /^content\-type:\s*([\w\/\-]+)\s*\;?\s*?([^\s]+)?\s*$/ims)
     517            /^content\-type:\s*([\w\/\-]+)\s*\;?\s*(.*?)\s*$/ims)
    511518            {
    512519            # The message header uses MIME flags
Note: See TracChangeset for help on using the changeset viewer.