Re: {bug?] fake dtd inside html comment beying used

On 06.11.99 at 19:45, Léa Gris <lea.gris@freesbee.fr> wrote:

>[I've] put a fake [DOCTYPE] inside [a comment]. The validator read it as
>the [DOCTYPE] to use instead of using the real one [in] the first line.

OK. Found & Fixed. It'll be in the next patch I send to Gerald. In the mean
time, anyone can edit the "check" CGI program on line 1144.

Original: $dttext =~ s/.*doctype\s+html\s+public\s*["']//i;
     New: $dttext =~ s/.*?doctype\s+html\s+public\s*["']//i;
_________________________^


The regex is greedy and so gobbles up the first DOCTYPE, leaving only the
second one.


Since this is a one-char fix I won't bother making a patch for it, but
while looking over this code I found some significant (read: *significant*)
potential for performance improvement and so I'll produce a patch for that
which will incorporate this fix.

Received on Saturday, 6 November 1999 15:44:16 UTC