Make content-disposition parsing more forgiving. Fixes bug 121509 and a

few existing evang bugs.  r=law, sr=mscott
This commit is contained in:
bzbarsky%mit.edu 2006-07-29 05:39:19 +00:00
parent 8b00a952bf
commit 8ae7a333e4

View File

@ -311,7 +311,7 @@ nsHeaderSniffer.prototype = {
if (name) {
const filenamePrefix = "filename=";
var ix = name.indexOf(filenamePrefix);
if (ix > 0) {
if (ix >= 0) {
// Adjust ix to point to start of actual name
ix += filenamePrefix.length;
filename = name.substr(ix, name.length);
@ -319,7 +319,8 @@ nsHeaderSniffer.prototype = {
ix = filename.lastIndexOf(";");
if (ix > 0)
filename = filename.substr(0, ix);
// XXX strip out quotes;
filename = filename.replace(/^"|"$/g, "");
}
}
}