Remove clean xss from datatype name and alias. (#15552)

* Remove clean xss from datatype name and alias.

* Edit / and \ to the exclusions argument

* Forgot to escape the backslash

---------

Co-authored-by: Lucas Bach Bisgaard <lom@novicell.dk>
This commit is contained in:
Lucas Bach Bisgaard
2024-02-10 01:50:03 +01:00
committed by GitHub
parent 7046c3585b
commit 9e5eb2da08

View File

@@ -45,7 +45,7 @@ internal sealed class DataTypeValidateAttribute : TypeFilterAttribute
var dataType = (DataTypeSave?)context.ActionArguments["dataType"];
if (dataType is not null)
{
dataType.Name = dataType.Name?.CleanForXss('[', ']', '(', ')', ':');
dataType.Name = dataType.Name?.CleanForXss('[', ']', '(', ')', ':', '/', '\\');
dataType.Alias = dataType.Alias == null
? dataType.Name!
: dataType.Alias.CleanForXss('[', ']', '(', ')', ':');