Bug 81280 - correctly handle user-typed ".." in linux filepicker. r=jag, sr=blizzard.

This commit is contained in:
bryner%netscape.com 2001-07-24 22:57:52 +00:00
Родитель 0714ae9359
Коммит fa091f1301
1 изменённых файлов: 8 добавлений и 0 удалений

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

@ -186,6 +186,14 @@ function onOK()
/* XXX we need an XP way to test for an absolute path! */
if (input[0] == '/') /* an absolute path was entered */
file.initWithUnicodePath(input);
else if ((input.indexOf("/../") > 0) ||
(input.substr(-3) == "/..") ||
(input.substr(0,3) == "../") ||
(input == "..")) {
/* appendRelativePath doesn't allow .. */
file.initWithUnicodePath(file.unicodePath + "/" + input);
file.normalize();
}
else {
try {
file.appendRelativeUnicodePath(input);