Bug 703015: revert change for bug 651185 - allow double-quotes for RFC 2231/5987 encoding again. r=bzbarsky, a=legneato
authorjulian.reschke@gmx.de
Tue, 22 Nov 2011 18:15:32 -0500
changeset 79234 687b18a8709e5fd5054b3ba295c9455dbd6569c5
parent 79233 c2e99970507689dac395b98c9eac48c80664d6d9
child 79235 c5ecaaed936d6abec65ecddbb15c3effeb44a790
push id78
push userclegnitto@mozilla.com
push dateFri, 16 Dec 2011 17:32:24 +0000
treeherdermozilla-release@79d24e644fdd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbzbarsky, legneato
bugs703015, 651185
milestone9.0
Bug 703015: revert change for bug 651185 - allow double-quotes for RFC 2231/5987 encoding again. r=bzbarsky, a=legneato
netwerk/mime/nsMIMEHeaderParamImpl.cpp
netwerk/test/unit/test_bug651185.js
netwerk/test/unit/xpcshell.ini
--- a/netwerk/mime/nsMIMEHeaderParamImpl.cpp
+++ b/netwerk/mime/nsMIMEHeaderParamImpl.cpp
@@ -295,19 +295,17 @@ nsMIMEHeaderParamImpl::GetParameterInter
              !nsCRT::strncasecmp(tokenStart, aParamName, paramLen) &&
              seenEquals &&
              *(tokenStart + paramLen) == '*')
     {
       const char *cp = tokenStart + paramLen + 1; // 1st char pass '*'
       PRBool needUnescape = *(tokenEnd - 1) == '*';
       // the 1st line of a multi-line parameter or a single line  that needs 
       // unescaping. ( title*0*=  or  title*= )
-      // only allowed for token form, not for quoted-string
-      if (!needUnquote &&
-          ((*cp == '0' && needUnescape) || (tokenEnd - tokenStart == paramLen + 1)))
+      if ((*cp == '0' && needUnescape) || (tokenEnd - tokenStart == paramLen + 1))
       {
         // look for single quotation mark(')
         const char *sQuote1 = PL_strchr(valueStart, 0x27);
         const char *sQuote2 = (char *) (sQuote1 ? PL_strchr(sQuote1 + 1, 0x27) : nsnull);
 
         // Two single quotation marks must be present even in
         // absence of charset and lang. 
         if (!sQuote1 || !sQuote2)
deleted file mode 100644
--- a/netwerk/test/unit/test_bug651185.js
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- * Test for bug 651185: double quotes around 2231/5987 encoded param
- */
-
-const Cr = Components.results
-
-var BS = '\\';
-var DQUOTE = '"'; 
- 
-var tests = [
-                 [ /* sanity check */
-                  "Content-Disposition: attachment; filename*=utf-8''%41", 
-                  "A"],
-                 [ /* the actual bug */
-                  "Content-Disposition: attachment; filename*=" + DQUOTE + "utf-8''%41" + DQUOTE, 
-                  Cr.NS_ERROR_INVALID_ARG],
-                ];
-
-function run_test() {
-
-  var mhp = Components.classes["@mozilla.org/network/mime-hdrparam;1"]
-                      .getService(Components.interfaces.nsIMIMEHeaderParam);
-
-  var unused = { value : null };
-
-  for (var i = 0; i < tests.length; ++i) {
-    dump("Testing " + tests[i] + "\n");
-    try {
-      do_check_eq(mhp.getParameter(tests[i][0], "filename", "UTF-8", true, unused),
-                  tests[i][1]);
-    }
-    catch (e) {
-      do_check_eq(e.result, tests[i][1]);
-    }
-  }
-}
-
--- a/netwerk/test/unit/xpcshell.ini
+++ b/netwerk/test/unit/xpcshell.ini
@@ -78,17 +78,16 @@ fail-if = os == "android"
 [test_bug654926_doom_and_read.js]
 # Bug 675049: test fails consistently on Android
 fail-if = os == "android"  
 [test_bug654926_test_seek.js]
 # Bug 675049: test fails consistently on Android
 fail-if = os == "android"  
 [test_bug659569.js]
 [test_bug660066.js]
-[test_bug651185.js]
 [test_bug667907.js]
 [test_bug670333.js]
 [test_bug667818.js]
 [test_cacheflags.js]
 [test_channel_close.js]
 [test_compareURIs.js]
 [test_content_sniffer.js]
 [test_cookie_header.js]