Disallow illegal chars in templates
This commit is contained in:
parent
7e00162ef2
commit
bc9625fece
@ -54,10 +54,7 @@ namespace LibationFileManager
|
|||||||
if (template is null)
|
if (template is null)
|
||||||
return new[] { ERROR_NULL_IS_INVALID };
|
return new[] { ERROR_NULL_IS_INVALID };
|
||||||
|
|
||||||
if (template.Contains(':')
|
if (ReplacementCharacters.ContainsInvalid(template.Replace("<","").Replace(">","")))
|
||||||
|| template.Contains(Path.DirectorySeparatorChar)
|
|
||||||
|| template.Contains(Path.AltDirectorySeparatorChar)
|
|
||||||
)
|
|
||||||
return new[] { ERROR_INVALID_FILE_NAME_CHAR };
|
return new[] { ERROR_INVALID_FILE_NAME_CHAR };
|
||||||
|
|
||||||
return Valid;
|
return Valid;
|
||||||
@ -200,6 +197,10 @@ namespace LibationFileManager
|
|||||||
if (template.Contains(':'))
|
if (template.Contains(':'))
|
||||||
return new[] { ERROR_FULL_PATH_IS_INVALID };
|
return new[] { ERROR_FULL_PATH_IS_INVALID };
|
||||||
|
|
||||||
|
// must be relative. no colons. all other path chars are valid enough to pass this check and will be handled on final save.
|
||||||
|
if (ReplacementCharacters.ContainsInvalid(template.Replace("<", "").Replace(">", "")))
|
||||||
|
return new[] { ERROR_INVALID_FILE_NAME_CHAR };
|
||||||
|
|
||||||
return Valid;
|
return Valid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user