Ignore:
Timestamp:
2002-07-05T11:24:42+12:00 (21 years ago)
Author:
jrm21
Message:

Fixed up some regexs for mime header encodings - eg people with accents in
their first names was not always displayed properly.

File:
1 edited

Legend:

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

    r3206 r3215  
    192192        my $encoded=$value;
    193193        $value="";
    194         # this isn't quite right yet regarding spaces between encoded-texts
    195         # (see examples, section 8. of rfc).
    196         while ($encoded =~ s/(.*?)=\?([^\?]*)\?([bq])\?([^\?]+)\?=\s*//i) {
     194        # we should ignore spaces between consecutive encoded-texts
     195        $encoded =~ s@\?=\s+=\?@\?==\?@g;
     196        while ($encoded =~ s/(.*?)=\?([^\?]*)\?([bq])\?([^\?]+)\?=//i) {
    197197        my ($charset, $encoding, $data)=($2,$3,$4);
    198198        my ($decoded_data);
     
    204204            $data =~ s/_/\ /g;  # from rfc2047 (sec 4.2.2)
    205205            $decoded_data=qp_decode($data);
     206            # qp_decode adds \n, which is default for body text
     207            chomp($decoded_data);
    206208        } else { # base 64
    207209            $decoded_data=base64_decode($data);
     
    255257
    256258    if (defined($fromnamemeta)) {
    257     $fromnamemeta =~ s/\"//g;
     259    $fromnamemeta =~ s/\"//g;  # remove quotes
     260    $fromnamemeta =~ s/\s+$//; # remove trailing whitespace
    258261    }
    259262    else {
Note: See TracChangeset for help on using the changeset viewer.