diff options
author | Steve Block <steveblock@google.com> | 2009-10-08 17:19:54 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2009-10-20 00:41:58 +0100 |
commit | 231d4e3152a9c27a73b6ac7badbe6be673aa3ddf (patch) | |
tree | a6c7e2d6cd7bfa7011cc39abbb436142d7a4a7c8 /WebCore/platform/KURLGoogle.cpp | |
parent | e196732677050bd463301566a68a643b6d14b907 (diff) | |
download | external_webkit-231d4e3152a9c27a73b6ac7badbe6be673aa3ddf.zip external_webkit-231d4e3152a9c27a73b6ac7badbe6be673aa3ddf.tar.gz external_webkit-231d4e3152a9c27a73b6ac7badbe6be673aa3ddf.tar.bz2 |
Merge webkit.org at R49305 : Automatic merge by git.
Change-Id: I8968561bc1bfd72b8923b7118d3728579c6dbcc7
Diffstat (limited to 'WebCore/platform/KURLGoogle.cpp')
-rw-r--r-- | WebCore/platform/KURLGoogle.cpp | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/WebCore/platform/KURLGoogle.cpp b/WebCore/platform/KURLGoogle.cpp index 1cb08c1..b323332 100644 --- a/WebCore/platform/KURLGoogle.cpp +++ b/WebCore/platform/KURLGoogle.cpp @@ -331,7 +331,7 @@ const String& KURLGooglePrivate::string() const // Creates with NULL-terminated string input representing an absolute URL. // WebCore generally calls this only with hardcoded strings, so the input is // ASCII. We treat is as UTF-8 just in case. -KURL::KURL(const char *url) +KURL::KURL(ParsedURLStringTag, const char *url) { // FIXME The Mac code checks for beginning with a slash and converting to a // file: URL. We will want to add this as well once we can compile on a @@ -349,7 +349,7 @@ KURL::KURL(const char *url) // to a string and then converted back. In this case, the URL is already // canonical and in proper escaped form so needs no encoding. We treat it was // UTF-8 just in case. -KURL::KURL(const String& url) +KURL::KURL(ParsedURLStringTag, const String& url) { if (!url.isNull()) m_url.init(KURL(), url, 0); @@ -728,13 +728,8 @@ String decodeURLEscapeSequences(const String& str) // cause security holes. We never call this function for components, and // just return the ASCII versions instead. // -// However, this static function is called directly in some cases. It appears -// that this only happens for javascript: URLs, so this is essentially the -// JavaScript URL decoder. It assumes UTF-8 encoding. -// -// IE doesn't unescape %00, forcing you to use \x00 in JS strings, so we do -// the same. This also eliminates NULL-related problems should a consumer -// incorrectly call this function for non-JavaScript. +// This function is also used to decode javascript: URLs and as a general +// purpose unescaping function. // // FIXME These should be merged to the KURL.cpp implementation. String decodeURLEscapeSequences(const String& str, const TextEncoding& encoding) @@ -757,15 +752,9 @@ String decodeURLEscapeSequences(const String& str, const TextEncoding& encoding) for (int i = 0; i < inputLength; i++) { if (input[i] == '%') { unsigned char ch; - if (url_canon::DecodeEscaped(input, &i, inputLength, &ch)) { - if (!ch) { - // Never unescape NULLs. - unescaped.push_back('%'); - unescaped.push_back('0'); - unescaped.push_back('0'); - } else - unescaped.push_back(ch); - } else { + if (url_canon::DecodeEscaped(input, &i, inputLength, &ch)) + unescaped.push_back(ch); + else { // Invalid escape sequence, copy the percent literal. unescaped.push_back('%'); } @@ -936,7 +925,7 @@ unsigned KURL::pathAfterLastSlash() const const KURL& blankURL() { - static KURL staticBlankURL("about:blank"); + static KURL staticBlankURL(ParsedURLString, "about:blank"); return staticBlankURL; } |