[Mimedefang] Update to MIMEDefang Filter KAM
Joseph Brennan
brennan at columbia.edu
Mon Apr 19 11:03:02 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?
a) Correct, this assumes html text has a natural limit, and it would
be better to actually test it. Now how do you test the size of an
entity? Anyone who knows can jump in here. I probably won't get
to this today. It is true that this test has run for almost a year
here without a problem that has been noticed.
b) Steffen, it sounds like you have a simpler way in mind to do the
changes and know whether to do the open("w"). What is it?
PS to Kevin- We're "Columbia University in the City of New York" not
the University of Columbia :-)
Joseph Brennan
Academic Technologies Group, Academic Information Systems (AcIS)
Columbia University in the City of New York
More information about the MIMEDefang
mailing list