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 249292 ac9e91778eb628ae359fbe87bda551769b83a679
parent 249291 9d2f1f3c5ab466372eee5d2e53639403230b8f28
child 249293 1b311ea5972239807714781b5ec7c2eac08b2abe
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcmanus, sledru
bugs1121826
milestone37.0a2
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
@@ -358,17 +358,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;