bug 909264 - control characters in the location bar should be %-encoded for visibility. r=gavin

This commit is contained in:
Jonathan Kew 2013-09-04 10:49:47 +01:00
parent 2e0932d7e9
commit abff0fd6d5

View File

@ -2214,9 +2214,10 @@ function losslessDecodeURI(aURI) {
encodeURIComponent);
} catch (e) {}
// Encode invisible characters (line and paragraph separator,
// object replacement character) (bug 452979)
value = value.replace(/[\v\x0c\x1c\x1d\x1e\x1f\u2028\u2029\ufffc]/g,
// Encode invisible characters (C0/C1 control characters, U+007F [DEL],
// U+00A0 [no-break space], line and paragraph separator,
// object replacement character) (bug 452979, bug 909264)
value = value.replace(/[\u0000-\u001f\u007f-\u00a0\u2028\u2029\ufffc]/g,
encodeURIComponent);
// Encode default ignorable characters (bug 546013)