Bug 1121826 - Backout cc192030c28f - brackets shouldn't be automatically escaped in the Query. r=mcmanus, a=sledru
authorValentin Gosu <valentin.gosu@gmail.com>
Sat, 17 Jan 2015 16:13:21 +0200
changeset 242946 12bda229bf83
parent 242945 55bd32c43abd
child 242947 c5dfa7d081f4
push id4343
push userryanvm@gmail.com
push date2015-01-20 16:38 +0000
treeherdermozilla-beta@c5dfa7d081f4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcmanus, sledru
bugs1121826
milestone36.0
Bug 1121826 - Backout cc192030c28f - brackets shouldn't be automatically escaped in the Query. r=mcmanus, a=sledru
netwerk/test/unit/test_standardurl.js
xpcom/io/nsEscape.cpp
--- a/netwerk/test/unit/test_standardurl.js
+++ b/netwerk/test/unit/test_standardurl.js
@@ -218,23 +218,23 @@ function test_clearedSpec()
 
   var ref = stringToURL("http://allizom.org/path");
   symmetricEquality(true, url, ref);
 }
 
 function test_escapeQueryBrackets()
 {
   var url = stringToURL("http://example.com/?a[x]=1");
-  do_check_eq(url.spec, "http://example.com/?a%5Bx%5D=1");
+  do_check_eq(url.spec, "http://example.com/?a[x]=1");
 
   url = stringToURL("http://example.com/?a%5Bx%5D=1");
   do_check_eq(url.spec, "http://example.com/?a%5Bx%5D=1");
 
   url = stringToURL("http://[2001::1]/?a[x]=1");
-  do_check_eq(url.spec, "http://[2001::1]/?a%5Bx%5D=1");
+  do_check_eq(url.spec, "http://[2001::1]/?a[x]=1");
 
   url = stringToURL("http://[2001::1]/?a%5Bx%5D=1");
   do_check_eq(url.spec, "http://[2001::1]/?a%5Bx%5D=1");
 }
 
 function run_test()
 {
   test_setEmptyPath();
--- a/xpcom/io/nsEscape.cpp
+++ b/xpcom/io/nsEscape.cpp
@@ -354,17 +354,17 @@ nsEscapeHTML2(const char16_t* aSourceBuf
 static const uint32_t EscapeChars[256] =
 //   0    1    2    3    4    5    6    7    8    9    A    B    C    D    E    F
 {
      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,   0,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,   0, 896,   0, 896,1023,  // 5x  PQRSTUVWXYZ[\]^_
+  1023,1023,1023,1023,1023,1023,1023,1023,1023,1023,1023, 896, 896, 896, 896,1023,  // 5x  PQRSTUVWXYZ[\]^_
      0,1023,1023,1023,1023,1023,1023,1023,1023,1023,1023,1023,1023,1023,1023,1023,  // 6x  `abcdefghijklmno
   1023,1023,1023,1023,1023,1023,1023,1023,1023,1023,1023, 896,1012, 896,1023,   0,  // 7x  pqrstuvwxyz{|}~ DEL
      0                                                                              // 80 to FF are zero
 };
 
 static uint16_t dontNeedEscape(unsigned char aChar, uint32_t aFlags)
 {
   return EscapeChars[(uint32_t)aChar] & aFlags;