Skip to content

Commit

Permalink
Fix isValidName error
Browse files Browse the repository at this point in the history
  • Loading branch information
lgh committed Nov 3, 2023
1 parent 2b1378c commit 9f7aac6
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -661,9 +661,12 @@ public static boolean isValidName(String src) {
String[] components = StringUtils.split(src, '/');
for (int i = 0; i < components.length; i++) {
String element = components[i];
// For Windows, we must allow the : in the drive letter.
if (Shell.WINDOWS && i == 1 && element.contains(":")) {
continue;
}
if (element.equals(".") ||
// For Windows, we must allow the : in the drive letter.
(!Shell.WINDOWS && i == 1 && element.contains(":")) ||
(element.contains(":")) ||
(element.contains("/"))) {
return false;
}
Expand Down

0 comments on commit 9f7aac6

Please sign in to comment.