W3C home > Mailing lists > Public > www-validator@w3.org > November 1999

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

From: Terje Bless <link@tss.no>
Date: Sat, 6 Nov 1999 21:22:52 +0100
Message-Id: <199911062043.VAA06502@vals.intramed.rito.no>
To: W3C Validator <www-validator@w3.org>
cc: Léa Gris <lea.gris@freesbee.fr>
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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:13:53 GMT