Skip to content

Commit 5afb917

Browse files
committed
Update BaseLayoutPage.cs
1 parent 6946095 commit 5afb917

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Files.App/Utils/Storage/Operations/FilesystemHelpers.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ private static char[] RestrictedCharacters
3434
{
3535
var userSettingsService = Ioc.Default.GetRequiredService<IUserSettingsService>();
3636
return userSettingsService.FoldersSettingsService.AreAlternateStreamsVisible
37-
? ['\\', '/', '*', '?', '"', '<', '>', '|'] // Allow ":" char
38-
: ['\\', '/', ':', '*', '?', '"', '<', '>', '|'];
37+
? Path.GetInvalidFileNameChars().Where(c => c != ':').ToArray() // Allow ":" char when alternate streams are visible
38+
: Path.GetInvalidFileNameChars();
3939
}
4040
}
4141

src/Files.App/Views/Layouts/BaseLayoutPage.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1031,7 +1031,7 @@ protected virtual void Page_PreviewKeyDown(object sender, KeyRoutedEventArgs e)
10311031
return;
10321032

10331033
// Handle valid character input
1034-
if (!Path.GetInvalidFileNameChars().Contains(char.ToLowerInvariant(typedCharacter.Value)))
1034+
if (!FilesystemHelpers.ContainsRestrictedCharacters(char.ToString(typedCharacter.Value)))
10351035
{
10361036
var lowerCharString = char.ToLowerInvariant(typedCharacter.Value).ToString();
10371037

0 commit comments

Comments
 (0)