зеркало из https://github.com/mozilla/pjs.git
bug 383478 deal with %00 in file urls, r=bz,darin
This commit is contained in:
Родитель
466530bf50
Коммит
4aa374a072
|
@ -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) == '\\')
|
||||
|
|
Загрузка…
Ссылка в новой задаче