[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.16-1409-g5afdf4d
dglazkov at chromium.org
dglazkov at chromium.org
Thu Dec 3 13:38:00 UTC 2009
The following commit has been merged in the webkit-1.1 branch:
commit 4b222b48b290c878d2be1e113178f951ce51d4ad
Author: dglazkov at chromium.org <dglazkov at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Nov 16 23:08:14 2009 +0000
2009-11-16 Dimitri Glazkov <dglazkov at chromium.org>
Reviewed by Darin Fisher.
[KURLGoogle] setHostAndPort doesn't handle arguments without port correctly.
Fix a bug in the code that was dormant until http://trac.webkit.org/changeset/50784.
Covered by existing test: LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-host.html
* platform/KURLGoogle.cpp:
(WebCore::KURL::setHostAndPort): Added handling of arguments without port specified.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51058 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 8cf8c37..b2057fb 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2009-11-16 Dimitri Glazkov <dglazkov at chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ [KURLGoogle] setHostAndPort doesn't handle arguments without port correctly.
+
+ Fix a bug in the code that was dormant until http://trac.webkit.org/changeset/50784.
+
+ Covered by existing test: LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-host.html
+
+ * platform/KURLGoogle.cpp:
+ (WebCore::KURL::setHostAndPort): Added handling of arguments without port specified.
+
2009-11-16 Alexey Proskuryakov <ap at apple.com>
Rubber-stamped by Jon Honeycutt.
diff --git a/WebCore/platform/KURLGoogle.cpp b/WebCore/platform/KURLGoogle.cpp
index 4336737..763bf3b 100644
--- a/WebCore/platform/KURLGoogle.cpp
+++ b/WebCore/platform/KURLGoogle.cpp
@@ -577,21 +577,25 @@ void KURL::setHost(const String& host)
m_url.replaceComponents(replacements);
}
-// This function is used only in the JSC build.
void KURL::setHostAndPort(const String& s)
{
- String newhost = s.left(s.find(":"));
- String newport = s.substring(s.find(":") + 1);
+ String host = s;
+ String port;
+ int hostEnd = s.find(":");
+ if (hostEnd != -1) {
+ host = s.left(hostEnd);
+ port = s.substring(hostEnd + 1);
+ }
KURLGooglePrivate::Replacements replacements;
// Host can't be removed, so we always set.
- replacements.SetHost(CharactersOrEmpty(newhost),
- url_parse::Component(0, newhost.length()));
+ replacements.SetHost(CharactersOrEmpty(host),
+ url_parse::Component(0, host.length()));
- if (newport.isEmpty()) // Port may be removed, so we support clearing.
+ if (port.isEmpty()) // Port may be removed, so we support clearing.
replacements.ClearPort();
else
- replacements.SetPort(CharactersOrEmpty(newport), url_parse::Component(0, newport.length()));
+ replacements.SetPort(CharactersOrEmpty(port), url_parse::Component(0, port.length()));
m_url.replaceComponents(replacements);
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list