Ignore decimal point when deciding if meta refresh contains garbage. r=radha@netscape.com sr=alecf@netscape.com a=asa@mozilla.org

This commit is contained in:
locka%iol.ie 2003-02-03 13:11:40 +00:00
parent 7432a9312b
commit 96cd687fd7

View File

@ -3854,11 +3854,13 @@ nsDocShell::SetupRefreshURIFromHeader(nsIURI * aBaseURI,
if (specifiesSeconds) if (specifiesSeconds)
{ {
// Non-whitespace characters here mean that the string is // Non-whitespace characters here mean that the string is
// malformed. // malformed but tolerate sites that specify a decimal point,
if (iter == iterAfterDigit && !nsCRT::IsAsciiSpace(*iter)) // even though meta refresh only works on whole seconds.
if (iter == iterAfterDigit &&
!nsCRT::IsAsciiSpace(*iter) && *iter != '.')
{ {
// There is no space between the seconds and this character // The characters between the seconds and the next
// so the seconds are garbage! // section are just garbage!
// e.g. content="2a0z+,URL=http://www.mozilla.org/" // e.g. content="2a0z+,URL=http://www.mozilla.org/"
// Just ignore this redirect. // Just ignore this redirect.
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;