mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-107516 ("." and ".." are not a valid file names)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -65,7 +65,7 @@ public class PathUtilRt {
|
||||
}
|
||||
|
||||
public static boolean isValidFileName(@NotNull String fileName) {
|
||||
if (fileName.length() == 0) {
|
||||
if (fileName.length() == 0 || fileName.equals(".") || fileName.equals("..")) {
|
||||
return false;
|
||||
}
|
||||
for (int i = 0; i < fileName.length(); i++) {
|
||||
@@ -75,6 +75,7 @@ public class PathUtilRt {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private static boolean isValidFileNameChar(char c) {
|
||||
return c != '/' && c != '\\' && c != '\t' && c != '\n' && c != '\r' && c != ':' && c != ';' && c != '*' && c != '?' &&
|
||||
c != '"' && c != '\'' && c != '<' && c != '>';
|
||||
|
||||
Reference in New Issue
Block a user