[Mimedefang] Update to MIMEDefang Filter KAM

Steffen Kaiser skmimedefang at smail.inf.fh-bonn-rhein-sieg.de
Mon Apr 19 03:13:58 EDT 2004


On Fri, 16 Apr 2004, Kevin A. McGrail wrote:

>       if ($io = $entity->open("r")) {
>         while (defined($currentline = $io->getline)) {
>           if ($currentline =~ s/<(iframe|script|object)\b/<no-$1 /ig) {
>             $badtag++;
>           }
>           $output .= $currentline;
>         }
>         $io->close;
>
>         if ($badtag) {
>           if ($io = $entity->open("w")) {
>             $io->print($output);
>             $io->close;
>           }

I wonder:

a) You read in all the entity into memory, without size check?

b) As you already have all the lines in memory, why don't you apply the
s// operation on $output once?

Bye,

-- 
Steffen Kaiser



More information about the MIMEDefang mailing list