summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-02-12 19:40:38 +0100
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-02-12 19:40:38 +0100
commit2c0b407f04e850b45c912917026e4945ec0dc2f5 (patch)
tree4c4ab226542e5b1d3c201b20d48156f905dff13a
parent26163d89884a6eadf66e15a8bf9e800aa960ba5f (diff)
downloadUXP-2c0b407f04e850b45c912917026e4945ec0dc2f5.tar
UXP-2c0b407f04e850b45c912917026e4945ec0dc2f5.tar.gz
UXP-2c0b407f04e850b45c912917026e4945ec0dc2f5.tar.lz
UXP-2c0b407f04e850b45c912917026e4945ec0dc2f5.tar.xz
UXP-2c0b407f04e850b45c912917026e4945ec0dc2f5.zip
JS - location.hash - no escape single quote
-rw-r--r--netwerk/test/unit/test_standardurl.js11
-rw-r--r--xpcom/io/nsEscape.cpp2
2 files changed, 12 insertions, 1 deletions
diff --git a/netwerk/test/unit/test_standardurl.js b/netwerk/test/unit/test_standardurl.js
index c4d44f41f..476c34b70 100644
--- a/netwerk/test/unit/test_standardurl.js
+++ b/netwerk/test/unit/test_standardurl.js
@@ -251,6 +251,17 @@ add_test(function test_escapeBrackets()
run_next_test();
});
+add_test(function test_escapeQuote()
+{
+ var url = stringToURL("http://example.com/#'");
+ do_check_eq(url.spec, "http://example.com/#'");
+ do_check_eq(url.ref, "'");
+ url.ref = "test'test";
+ do_check_eq(url.spec, "http://example.com/#test'test");
+ do_check_eq(url.ref, "test'test");
+ run_next_test();
+});
+
add_test(function test_apostropheEncoding()
{
// For now, single quote is escaped everywhere _except_ the path.
diff --git a/xpcom/io/nsEscape.cpp b/xpcom/io/nsEscape.cpp
index f16edc4ce..117e20d60 100644
--- a/xpcom/io/nsEscape.cpp
+++ b/xpcom/io/nsEscape.cpp
@@ -346,7 +346,7 @@ static const uint32_t EscapeChars[256] =
{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0x
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 1x
- 0,1023, 0, 512,1023, 0,1023, 112,1023,1023,1023,1023,1023,1023, 953, 784, // 2x !"#$%&'()*+,-./
+ 0,1023, 0, 512,1023, 0,1023, 624,1023,1023,1023,1023,1023,1023, 953, 784, // 2x !"#$%&'()*+,-./
1023,1023,1023,1023,1023,1023,1023,1023,1023,1023,1008,1008, 0,1008, 0, 768, // 3x 0123456789:;<=>?
1008,1023,1023,1023,1023,1023,1023,1023,1023,1023,1023,1023,1023,1023,1023,1023, // 4x @ABCDEFGHIJKLMNO
1023,1023,1023,1023,1023,1023,1023,1023,1023,1023,1023,1008, 896,1008, 896,1023, // 5x PQRSTUVWXYZ[\]^_