Bug 78049 - [testcase] HTTP-EQUIV="refresh" not working with wierd formating.
Summary: [testcase] HTTP-EQUIV="refresh" not working with wierd formating.
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-03-20 03:10 UTC by jtwatson
Modified: 2004-03-20 14:35 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jtwatson 2004-03-20 03:10:21 UTC
Version:           3.2.0 (using KDE 3.2 BRANCH >= 20040204, Mandrake Linux Cooker i586 - Cooker)
Compiler:          gcc version 3.3.2 (Mandrake Linux 10.0 3.3.2-6mdk)
OS:          Linux (i686) release 2.6.3-4mdk

On Ebay's site, they use a redirect that has a new line in the the meta tag content, so that it spans two lines.

Example:

<html>
<head>
<title>Redirecting to Paypal</title>
<meta HTTP-EQUIV="refresh" content="
0;URL=http://www.paypal.com">
</head>
<body>
Redirecting to Paypal
</body>
</html>

If this newline is removed from the above code, Konqueror handles it just fine.

IE, NS, and Mozilla have no problems with the new line being there.
Comment 1 Dirk Mueller 2004-03-20 14:35:10 UTC
CVS commit by mueller: 

CCMAIL: 78049-done@bugs.kde.org


  M +5 -0      ChangeLog   1.233
  M +7 -14     xml/dom_docimpl.cpp   1.275


--- kdelibs/khtml/xml/dom_docimpl.cpp  #1.274:1.275
@@ -959,5 +959,5 @@ void DocumentImpl::recalcStyle( StyleCha
         _style->setFontDef(fontDef);
         _style->htmlFont().update( paintDeviceMetrics() );
-        if ( parseMode() != Strict )
+        if ( inCompatMode() )
             _style->setHtmlHacks(true); // enable html specific rendering tricks
 
@@ -1505,21 +1505,14 @@ void DocumentImpl::processHttpEquiv(cons
             pos = str.find(QRegExp("[ \t]"));
 
+        bool ok = false;
+        int delay = kMax( 0, content.implementation()->toInt(&ok) );
+        if ( !ok && str.length() && str[0] == '.' )
+            ok = true;
+
         if (pos == -1) // There can be no url (David)
         {
-            bool ok = false;
-            int delay = 0;
-            delay = content.implementation()->toInt(&ok);
             if(ok)
                 v->part()->scheduleRedirection(delay, v->part()->url().url() );
         } else {
-            int delay = 0;
-            int fract = pos;
-            bool ok = false;
-            if ( (fract = str.find('.') ) < 0 || fract > pos)
-                fract = pos;
-            DOMStringImpl* s = content.implementation()->substring(0, fract);
-            delay = s->toInt(&ok);
-            delete s;
-
             pos++;
             while(pos < (int)str.length() && str[pos].isSpace()) pos++;
@@ -1533,5 +1526,5 @@ void DocumentImpl::processHttpEquiv(cons
             str = parseURL( DOMString(str) ).string();
             QString newURL = getDocument()->completeURL( str );
-            if ( ok || !fract)
+            if ( ok )
                 v->part()->scheduleRedirection(delay, getDocument()->completeURL( str ),  delay < 2 || newURL == URL().url());
         }

--- kdelibs/khtml/ChangeLog  #1.232:1.233
@@ -1,2 +1,7 @@
+2004-03-20  Dirk Mueller  <mueller@kde.org>
+
+        * xml/dom_docimpl.cpp (processHttpEquiv): improve refresh handling for negative and
+        slightly malformed delays (#78049)
+
 2004-03-18  Lubos Lunak <l.lunak@kde.org>