Skip to content

Commit

Permalink
Disallow certain chracters but allow spaces in the filename
Browse files Browse the repository at this point in the history
  • Loading branch information
mendhak committed Nov 5, 2023
1 parent 56dd4a2 commit 06e0868
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ public void requestToggleLogging() {
final List<String> cachedList = Files.getListFromCacheFile(PreferenceNames.CUSTOM_FILE_NAME, getActivity());
formElements.add(Input.plain(PreferenceNames.CUSTOM_FILE_NAME)
.required()
.validatePattern("^[^*&%/\\s]+$", "Invalid file name")
// Don't allow *, &, %, / or \ in the file name.
.validatePattern("^[^*&%/\\]+$", "Invalid file name")
.suggest(new ArrayList<>(cachedList))
.text(preferenceHelper.getCustomFileName())
);
Expand Down

0 comments on commit 06e0868

Please sign in to comment.