Skip to content

Commit

Permalink
Merge pull request #421 from rockbite/asset-name
Browse files Browse the repository at this point in the history
Bugfix: AssetNameFieldFilter bad filter rules.
  • Loading branch information
TheSenPie committed Jul 24, 2023
2 parents 02257e0 + 37d7640 commit d4ec8c0
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2269,7 +2269,11 @@ private static class AssetNameFieldFilter implements TextField.TextFieldFilter {

@Override
public boolean acceptChar (TextField textField, char c) {
return !(c == '/' || c == '?' || c == '<' || c == '>' || c == '\\' || c == ':' || c == '*' || c == '|' || c == '"');
return isLatinLetterOrDigit(c) || Character.isWhitespace(c) || c == '-' || c == '_' || c == '.';
}

private static boolean isLatinLetterOrDigit (char c) {
return (48 <= c && c <= 57) || (65 <= c && c <= 90) || (97 <= c && c <= 122); // check digit, upper case and lowercase
}
}
}

0 comments on commit d4ec8c0

Please sign in to comment.