зеркало из https://github.com/mozilla/gecko-dev.git
fix bug 120959 [Use of ".." in address causes links to relative URL's
to fail] A regression from the rewrite of the urlparser, r=dougt@netscape.com, sr=darin@netscape.com
This commit is contained in:
Родитель
27978a05e9
Коммит
a59c0cac45
|
@ -325,6 +325,10 @@ nsBaseURLParser::ParseFilePath(const char *filepath, PRInt32 filepathLen,
|
|||
for (p = end - 1; *p != '/' && p > filepath; --p)
|
||||
;
|
||||
if (*p == '/') {
|
||||
// catch /.. and /.
|
||||
if ((p+1 < end && *(p+1) == '.') &&
|
||||
(p+2 == end || (p+2 < end && *(p+2) == '.' && p+3 == end)))
|
||||
p = end - 1;
|
||||
// filepath = <directory><filename>.<extension>
|
||||
SET_RESULT(directory, 0, p - filepath + 1);
|
||||
ParseFileName(p + 1, end - (p + 1),
|
||||
|
|
Загрузка…
Ссылка в новой задаче