WebCore should not send invalid URLs to client createWindow methods.
authorap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 21 Jan 2012 00:09:34 +0000 (00:09 +0000)
committerap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 21 Jan 2012 00:09:34 +0000 (00:09 +0000)
        https://bugs.webkit.org/show_bug.cgi?id=39017

        Unreviewed test fix.

        * page/DOMWindow.cpp: (WebCore::DOMWindow::createWindow): Let empty URLs through.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@105554 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/page/DOMWindow.cpp

index 7ebf203..9b92012 100755 (executable)
@@ -1,3 +1,12 @@
+2012-01-20  Alexey Proskuryakov  <ap@apple.com>
+
+        WebCore should not send invalid URLs to client createWindow methods.
+        https://bugs.webkit.org/show_bug.cgi?id=39017
+
+        Unreviewed test fix.
+
+        * page/DOMWindow.cpp: (WebCore::DOMWindow::createWindow): Let empty URLs through.
+
 2012-01-20  Sam Weinig  <sam@webkit.org>
 
         Make WebCore RunLoop work for WebKit1
index a6a64c8..dfc2eb9 100644 (file)
@@ -1773,7 +1773,7 @@ Frame* DOMWindow::createWindow(const String& urlString, const AtomicString& fram
     String referrer = firstFrame->loader()->outgoingReferrer();
 
     KURL completedURL = urlString.isEmpty() ? KURL(ParsedURLString, emptyString()) : firstFrame->document()->completeURL(urlString);
-    if (!completedURL.isValid()) {
+    if (!completedURL.isEmpty() && !completedURL.isValid()) {
         // Don't expose client code to invalid URLs.
         activeWindow->printErrorMessage("Unable to open a window with invalid URL '" + completedURL.string() + "'.\n");
         return 0;