diff --git a/BFR/MainWindow.xaml.cs b/BFR/MainWindow.xaml.cs index fc65dba..196e6d8 100644 --- a/BFR/MainWindow.xaml.cs +++ b/BFR/MainWindow.xaml.cs @@ -58,9 +58,10 @@ namespace BFR // Validate that there are any changes, and that the new file names are all unique. IsCommitButtonEnabled = - Files.Any(x => x.Path != x.OldPath) // Check for changes - && Files.GroupBy(x => x.Path).All(g => g.Count() == 1) // Check for duplicates - && !Files.Any(x => x.FullName == ""); // Check for invalid file names; TODO: Further validation + Files.Any(x => x.Path != x.OldPath) // Check for changes + && Files.GroupBy(x => x.Path).All(g => g.Count() == 1) // Check for duplicates + && !Files.Any(x => x.FullName == "") // Check for empty file names + && !Files.Any(x => "?%*:<>|/\\\"".Any(y => x.FullName.Contains(y))); // Check for invalid characters // Refresh the file list to guarantee that changes are displayed. TODO: Find a better way to do this. Files.ReplaceAll(new List(Files));