Changeset 3721


Ignore:
Timestamp:
2003-02-03T11:02:04+13:00 (21 years ago)
Author:
jrm21
Message:

bug where some text/plain messages weren't having < > & properly escaped.
Also some minor code formatting changes for consistency.

File:
1 edited

Legend:

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

    r3630 r3721  
    537537            $part_text= $self->text_from_part($message_part);
    538538            if ($part_text =~/[^\s]/) {
    539                 $part_text="<pre>".$part_text."</pre>";
     539                $part_text = text_into_html($part_text);
    540540            }
    541541            $mimetype="text/plain";
     
    544544        }
    545545        }
    546         if ($part_text eq "") { # use first part
    547         $part_text= $self->text_from_part(shift @message_parts);
     546        if ($part_text eq "") { #use first part (no html/text part found)
     547        $part_text = $self->text_from_part(shift @message_parts);
     548        $part_text = text_into_html($part_text);
    548549        }
    549550        if ($part_text eq "") { # we couldn't get anything!!!
     
    552553        print $outhandle "EMAILPlug: no text - empty body?\n";
    553554        } else {
    554         $text=$part_text;
     555        $text = $part_text;
    555556        }
    556557    } elsif ($mimetype =~ m@multipart/(mixed|digest|related|signed)@) {
    557         $text="";
     558        $text = "";
    558559        # signed is for PGP/GPG messages... the last part is a hash
    559560        if ($mimetype =~ m@multipart/signed@) {
     
    609610            my $part_text= $self->text_from_part($message_part);
    610611            if ($part_content_type !~ m@text/(ht|x)ml@) {
    611             $part_text=text_into_html($part_text);
     612            $part_text = text_into_html($part_text);
    612613            }
    613614            if ($part_text eq "") {
    614             $part_text='&lt;&lt;empty message&gt;&gt;';
     615            $part_text = '&lt;&lt;empty message&gt;&gt;';
    615616            }
    616             $text.=$part_text;
     617            $text .= $part_text;
    617618        } elsif ($part_content_type =~ m@message/rfc822@) {
    618619            # This is a forwarded message
     
    699700            open (SAVE, ">$tmpdir/$save_filename") ||
    700701                warn "EMAILPlug: Can't save attachment as $tmpdir/$save_filename: $!";
    701             $part_text=$message_part;
     702            $part_text = $message_part;
    702703            $part_text =~ s/(.*?)\r?\n\r?\n//s; # remove header
    703704            if ($encoding eq "base64") {
Note: See TracChangeset for help on using the changeset viewer.