Bug 402298 - Random base64 file names can contain '/'. r=jst, sr=jst, b1.9=mconnor, a=blockingM9

git-svn-id: svn://10.0.0.236/trunk@238476 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
edward.lee%engineering.uiuc.edu 2007-11-03 17:47:20 +00:00
parent 969345df41
commit 0b78a933bf

View File

@ -1175,6 +1175,10 @@ nsresult nsExternalAppHandler::SetUpTempFile(nsIChannel * aChannel)
PR_Free(b64);
b64 = nsnull;
// Base64 characters are alphanumeric (a-zA-Z0-9) and '+' and '/', so we need
// to replace illegal characters -- notably '/'
tempLeafName.ReplaceChar(FILE_PATH_SEPARATOR FILE_ILLEGAL_CHARACTERS, '_');
// now append our extension.
nsCAutoString ext;
mMimeInfo->GetPrimaryExtension(ext);