Bug 452979 p=Masahiro Yamada <masa141421356@gmail.com>, r=gavin, a=beltzner
authorMasayuki Nakano <masayuki@d-toybox.com>
Thu, 13 Nov 2008 01:24:51 +0900
changeset 21597 4a4e856855e670ded21171d2cb590d871e4ccf3f
parent 21596 f22c0016f923c2d3c9c11f79332791355ea77be5
child 21598 97e392fb01130d66165de11381399d661ac5d06a
push idunknown
push userunknown
push dateunknown
reviewersgavin, beltzner
bugs452979
milestone1.9.1b2pre
Bug 452979 p=Masahiro Yamada <masa141421356@gmail.com>, r=gavin, a=beltzner
browser/base/content/browser.js
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -2090,16 +2090,21 @@ function losslessDecodeURI(aURI) {
                 //    ';', '/', '?', ':', '@', '&', '=', '+', '$', ',', '#'
                 //    (RFC 3987 section 3.2)
                 // 2. Re-encode whitespace so that it doesn't get eaten away
                 //    by the location bar (bug 410726).
                 .replace(/%(?!3B|2F|3F|3A|40|26|3D|2B|24|2C|23)|[\r\n\t]/ig,
                          encodeURIComponent);
     } catch (e) {}
 
+  // Encode invisible characters (invisible control characters, soft hyphen,
+  // zero-width space, BOM, line separator, paragraph separator) (bug 452979)
+  value = value.replace(/[\v\x0c\x1c\x1d\x1e\x1f\u00ad\u200b\ufeff\u2028\u2029]/g,
+                        encodeURIComponent);
+
   // Encode bidirectional formatting characters.
   // (RFC 3987 sections 3.2 and 4.1 paragraph 6)
   value = value.replace(/[\u200e\u200f\u202a\u202b\u202c\u202d\u202e]/g,
                         encodeURIComponent);
   return value;
 }
 
 function UpdateUrlbarSearchSplitterState()