bug 383478 deal with %00 in file urls, r=bz,darin

This commit is contained in:
dveditz@cruzio.com 2007-07-12 16:04:24 -07:00
Родитель 56a324e667
Коммит a9712ad6f2
4 изменённых файлов: 8 добавлений и 0 удалений

Просмотреть файл

@ -130,6 +130,8 @@ net_GetFileFromURLSpec(const nsACString &aURL, nsIFile **result)
}
NS_UnescapeURL(path);
if (path.Length() != strlen(path.get()))
return NS_ERROR_FILE_INVALID_PATH;
// remove leading '\'
if (path.CharAt(0) == '\\')

Просмотреть файл

@ -231,6 +231,8 @@ net_GetFileFromURLSpec(const nsACString &aURL, nsIFile **result)
}
NS_UnescapeURL(path);
if (path.Length() != strlen(path.get()))
return NS_ERROR_FILE_INVALID_PATH;
if (bHFSPath)
convertHFSPathtoPOSIX(path, path);

Просмотреть файл

@ -114,6 +114,8 @@ net_GetFileFromURLSpec(const nsACString &aURL, nsIFile **result)
}
NS_UnescapeURL(path);
if (path.Length() != strlen(path.get()))
return NS_ERROR_FILE_INVALID_PATH;
if (IsUTF8(path)) {
// speed up the start-up where UTF-8 is the native charset

Просмотреть файл

@ -130,6 +130,8 @@ net_GetFileFromURLSpec(const nsACString &aURL, nsIFile **result)
}
NS_UnescapeURL(path);
if (path.Length() != strlen(path.get()))
return NS_ERROR_FILE_INVALID_PATH;
// remove leading '\'
if (path.CharAt(0) == '\\')