bug 22886 - Relax refresh header paring, in the sink, a little bit.

r=pollmann


git-svn-id: svn://10.0.0.236/trunk@76576 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
harishd%netscape.com
2000-08-17 20:55:48 +00:00
parent be80e197f0
commit 6368271fde
2 changed files with 14 additions and 4 deletions

View File

@@ -4189,13 +4189,18 @@ HTMLContentSink::ProcessMETATag(const nsIParserNode& aNode)
PRBool done = PR_FALSE;
while (!done && !token.IsEmpty()) {
token.CompressWhitespace();
if (millis == -1 && nsCRT::IsAsciiDigit(token.First())) {
// Ref. bug 22886
// Apparently CONTENT can also start with a period (.).
// Ex: <meta http-equiv = "refresh" content=".1; url=./recommendations1.html">
// So let's relax a little bit otherwise http://www.mozillazine.org/resources/
// wouldn't get redirected to the correct URL.
if (millis == -1 && (nsCRT::IsAsciiDigit(token.First()) || token.First()==PRUnichar('.'))) {
PRBool tokenIsANumber = PR_TRUE;
nsReadingIterator<PRUnichar> doneIterating(token.EndReading());
nsReadingIterator<PRUnichar> iter(token.BeginReading());
while ( iter != doneIterating )
{
if ( !(tokenIsANumber = nsCRT::IsAsciiDigit(*iter)) )
if (!(tokenIsANumber = nsCRT::IsAsciiDigit(*iter)) && *iter!=PRUnichar('.'))
break;
++iter;
}