Changed to delay unescaping URI so it's only applied to a folder path portsion, bug 52165, r=putterman, a=alecf.

This commit is contained in:
nhotta%netscape.com 2000-09-26 22:09:59 +00:00
parent b73b132aff
commit 504a3095ba
2 changed files with 9 additions and 11 deletions

View File

@ -193,7 +193,15 @@ nsLocalURI2Path(const char* rootURI, const char* uriStr,
nsCAutoString newPath("");
NS_MsgCreatePathStringFromFolderURI(curPos, newPath);
char *unescaped = nsCRT::strdup(curPos);
// Unescape folder name
if (unescaped) {
nsUnescape(unescaped);
NS_MsgCreatePathStringFromFolderURI(unescaped, newPath);
PR_Free(unescaped);
}
else
NS_MsgCreatePathStringFromFolderURI(curPos, newPath);
pathResult+=newPath.GetBuffer();
}

View File

@ -309,16 +309,6 @@ nsresult nsMailboxService::PrepareMessageUrl(const char * aSrcMsgMailboxURI, nsI
nsMsgKey msgKey;
const char *part = PL_strstr(aSrcMsgMailboxURI, "part=");
rv = nsParseLocalMessageURI(aSrcMsgMailboxURI, folderURI, &msgKey);
// Unescape folder name
char *unescapedFolderURI = nsCRT::strdup(folderURI);
if (unescapedFolderURI)
{
nsUnescape(unescapedFolderURI);
folderURI.Assign(unescapedFolderURI);
PR_Free(unescapedFolderURI);
}
rv = nsLocalURI2Path(kMailboxMessageRootURI, folderURI, folderPath);
if (NS_SUCCEEDED(rv))