Commit 1c0157cb authored by Avris's avatar Avris

fix project name validation

parent 5f01a1ae
......@@ -23,6 +23,7 @@ class ProjectForm extends Form
->add('name', Widget\Text::class, [], [
new Assert\NotBlank(),
new Assert\Regexp('^\w[\w-.]*\w$', l('validator.NameFormat')),
new Assert\Unique(
......@@ -14,7 +14,7 @@ class ServerForm extends Form
->add('name', Text::class, [], [
new Assert\NotBlank(),
new Assert\Regexp('^\w[\w-.]*\w$')
new Assert\Regexp('^\w[\w-.]*\w$', l('validator.NameFormat'))
->add('url', Url::class, [], [])
......@@ -175,6 +175,7 @@ api:
NewProjectUser: This user already has access to the project.
UrlTemplate: This field must be a URL containing a placeholder {{server}}
NameFormat: The value can only contain letters, numbers, dashes and dots.
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment