mirror of
https://github.com/sp-tarkov/installer.git
synced 2025-02-13 01:10:46 -05:00
Merge pull request #25 from waffle-lord/disallow-symbols-in-path
update path validation
This commit is contained in:
commit
e6eed2b992
@ -10,8 +10,8 @@
|
|||||||
<PackageIcon>icon.ico</PackageIcon>
|
<PackageIcon>icon.ico</PackageIcon>
|
||||||
<ApplicationIcon>Assets\spt_installer.ico</ApplicationIcon>
|
<ApplicationIcon>Assets\spt_installer.ico</ApplicationIcon>
|
||||||
<Configurations>Debug;Release;TEST</Configurations>
|
<Configurations>Debug;Release;TEST</Configurations>
|
||||||
<AssemblyVersion>2.93</AssemblyVersion>
|
<AssemblyVersion>2.94</AssemblyVersion>
|
||||||
<FileVersion>2.93</FileVersion>
|
<FileVersion>2.94</FileVersion>
|
||||||
<Company>SPT</Company>
|
<Company>SPT</Company>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
@ -87,17 +87,17 @@ public class InstallPathSelectionViewModel : ViewModelBase
|
|||||||
|
|
||||||
public void ValidatePath()
|
public void ValidatePath()
|
||||||
{
|
{
|
||||||
if (String.IsNullOrEmpty(SelectedPath))
|
if (String.IsNullOrEmpty(SelectedPath) || SelectedPath.Length < 4)
|
||||||
{
|
{
|
||||||
ErrorMessage = "Please provide an install path";
|
ErrorMessage = "Please provide an install path";
|
||||||
ValidPath = false;
|
ValidPath = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var match = Regex.Match(SelectedPath[2..], @"[\/:*?""<>|]");
|
var match = Regex.Match(SelectedPath[2..], @"[\/:*?""<>|!@#$%^&*+=,[\]{}`~;']|\\\\");
|
||||||
if (match.Success)
|
if (match.Success)
|
||||||
{
|
{
|
||||||
ErrorMessage = "Path cannot contain these characters: / : * ? \" < > |";
|
ErrorMessage = "Path cannot contain symbols other than ( ) \\ - _ .";
|
||||||
ValidPath = false;
|
ValidPath = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user