Bug 505037 - ".&" or some control chars in filenames of a local file causes it to break directory view when you browse to it or go directly. r=biesi

This commit is contained in:
Hugues Fournier 2009-10-17 12:39:01 +02:00
parent de67ac6940
commit f2c7d9c93d

View File

@ -940,7 +940,10 @@ nsIndexedToHTML::OnIndexAvailable(nsIRequest *aRequest,
PRInt32 lastDot = escapeBuf.RFindChar('.');
if (lastDot != kNotFound) {
escapeBuf.Cut(0, lastDot);
AppendUTF8toUTF16(escapeBuf, pushBuffer);
NS_ConvertUTF8toUTF16 utf16EscapeBuf(escapeBuf);
nsString htmlFileExt;
htmlFileExt.Adopt(nsEscapeHTML2(utf16EscapeBuf.get(), utf16EscapeBuf.Length()));
pushBuffer.Append(htmlFileExt);
} else {
pushBuffer.AppendLiteral("unknown");
}