From e736324bae36d66bf3922f783476bc7475d194e5 Mon Sep 17 00:00:00 2001 From: "terentev.a.a" Date: Thu, 28 Nov 2024 17:11:48 +0300 Subject: [PATCH] Use LocalPath and refine folder name validation Changed the usage from AbsolutePath to LocalPath for folder paths to ensure compatibility with local file paths. Improved folder name validation by checking for whitespace instead of checking for uppercase letters or non-letter characters. --- src/Gml.Launcher/Views/Pages/SettingsPageView.axaml.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Gml.Launcher/Views/Pages/SettingsPageView.axaml.cs b/src/Gml.Launcher/Views/Pages/SettingsPageView.axaml.cs index cca9e6a..8fba174 100644 --- a/src/Gml.Launcher/Views/Pages/SettingsPageView.axaml.cs +++ b/src/Gml.Launcher/Views/Pages/SettingsPageView.axaml.cs @@ -50,9 +50,9 @@ private async void OpenFileDialog(object? sender, RoutedEventArgs e) if (folders.Count != 1) return; - var path = folders[0].Path.AbsolutePath; + var path = folders[0].Path.LocalPath; - if (path.Any(c => !char.IsLetter(c) || !char.IsLower(c) || c > 'z')) + if (path.Any(char.IsWhiteSpace)) { throw new Exception("Invalid folder name"); }