Commit 4f28dd5b authored by ap@webkit.org's avatar ap@webkit.org
Browse files

Reviewed by Darin Adler.

        https://bugs.webkit.org/show_bug.cgi?id=22104
        Javascript URL percent encoding/decoding broken by some characters

        Test: fast/loader/javascript-url-encoding-2.html

        * platform/KURL.cpp: (WebCore::encodeRelativeString): Don't try to break down javascript URLs.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@38243 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent aa0c0fdd
2008-11-09 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Darin Adler.
https://bugs.webkit.org/show_bug.cgi?id=22104
Javascript URL percent encoding/decoding broken by some characters
* fast/loader/javascript-url-encoding-2-expected.txt:
* fast/loader/javascript-url-encoding-2.html:
2008-11-09 Darin Adler <darin@apple.com>
Reviewed by Sam Weinig.
......
Should be Cyrillic text, not U+FFFD REPLACEMENT CHARACTERS: Проверка
<head>
<meta charset="windows-1251">
<script>
function test()
{
if (window.layoutTestController) {
layoutTestController.dumpAsText();
layoutTestController.waitUntilDone();
}
window.location.href="javascript:'<p foo=\"?\">Should be Cyrillic text, not U+FFFD REPLACEMENT CHARACTERS: </p><script>if (window.layoutTestController) layoutTestController.notifyDone()</scr" + "ipt>'";
}
</script>
</head>
<body onload="test()">
</body>
2008-11-09 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Darin Adler.
https://bugs.webkit.org/show_bug.cgi?id=22104
Javascript URL percent encoding/decoding broken by some characters
Test: fast/loader/javascript-url-encoding-2.html
* platform/KURL.cpp: (WebCore::encodeRelativeString): Don't try to break down javascript URLs.
2008-11-09 Holger Hans Peter Freyther <zecke@selfish.org>
 
Reviewed and tweaked by Darin Adler.
......@@ -1480,7 +1480,7 @@ static void encodeRelativeString(const String& rel, const TextEncoding& encoding
TextEncoding pathEncoding(UTF8Encoding()); // Path is always encoded as UTF-8; other parts may depend on the scheme.
int pathEnd = -1;
if (encoding != pathEncoding && encoding.isValid() && !protocolIs(rel, "mailto") && !protocolIs(rel, "data")) {
if (encoding != pathEncoding && encoding.isValid() && !protocolIs(rel, "mailto") && !protocolIs(rel, "data") && !protocolIs(rel, "javascript")) {
// Find the first instance of either # or ?, keep pathEnd at -1 otherwise.
pathEnd = findFirstOf(s.data(), s.size(), 0, "#?");
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment