0
0
mirror of https://github.com/sp-tarkov/installer.git synced 2025-02-12 15:10:45 -05:00

Merge pull request #25 from waffle-lord/disallow-symbols-in-path

update path validation
This commit is contained in:
waffle-lord 2024-12-04 18:09:11 -05:00 committed by GitHub
commit e6eed2b992
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 5 deletions

View File

@ -10,8 +10,8 @@
<PackageIcon>icon.ico</PackageIcon>
<ApplicationIcon>Assets\spt_installer.ico</ApplicationIcon>
<Configurations>Debug;Release;TEST</Configurations>
<AssemblyVersion>2.93</AssemblyVersion>
<FileVersion>2.93</FileVersion>
<AssemblyVersion>2.94</AssemblyVersion>
<FileVersion>2.94</FileVersion>
<Company>SPT</Company>
</PropertyGroup>

View File

@ -87,17 +87,17 @@ public class InstallPathSelectionViewModel : ViewModelBase
public void ValidatePath()
{
if (String.IsNullOrEmpty(SelectedPath))
if (String.IsNullOrEmpty(SelectedPath) || SelectedPath.Length < 4)
{
ErrorMessage = "Please provide an install path";
ValidPath = false;
return;
}
var match = Regex.Match(SelectedPath[2..], @"[\/:*?""<>|]");
var match = Regex.Match(SelectedPath[2..], @"[\/:*?""<>|!@#$%^&*+=,[\]{}`~;']|\\\\");
if (match.Success)
{
ErrorMessage = "Path cannot contain these characters: / : * ? \" < > |";
ErrorMessage = "Path cannot contain symbols other than ( ) \\ - _ .";
ValidPath = false;
return;
}