зеркало из https://github.com/mozilla/pjs.git
Followup patch to deal with escaped characters, bug 367428 r=biesi
This commit is contained in:
Родитель
0eba768f5a
Коммит
d7b8769ad1
|
@ -51,6 +51,7 @@
|
|||
#include "nsDirectoryServiceDefs.h"
|
||||
#include "nsNetUtil.h"
|
||||
#include "nsURLHelper.h"
|
||||
#include "nsEscape.h"
|
||||
|
||||
static NS_DEFINE_CID(kResURLCID, NS_RESURL_CID);
|
||||
|
||||
|
@ -331,8 +332,11 @@ nsResProtocolHandler::ResolveURI(nsIURI *uri, nsACString &result)
|
|||
url->GetFilePath(filepath);
|
||||
|
||||
// Don't misinterpret the filepath as an absolute URI.
|
||||
if (filepath.FindChar(':') != -1 ||
|
||||
filepath.FindChar('\\') != -1)
|
||||
if (filepath.FindChar(':') != -1)
|
||||
return NS_ERROR_MALFORMED_URI;
|
||||
|
||||
NS_UnescapeURL(filepath);
|
||||
if (filepath.FindChar('\\') != -1)
|
||||
return NS_ERROR_MALFORMED_URI;
|
||||
|
||||
const char *p = path.get() + 1; // path always starts with a slash
|
||||
|
|
|
@ -11,6 +11,8 @@ const specs = [
|
|||
"resource:///file:///",
|
||||
"resource:///..\\",
|
||||
"resource:///..\\..\\",
|
||||
"resource:///..%5C",
|
||||
"resource:///..%5c"
|
||||
];
|
||||
|
||||
function check_for_exception(spec)
|
||||
|
|
Загрузка…
Ссылка в новой задаче