|
@@ -280,7 +280,7 @@ class Package
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- if (!preg_match('{^[a-z0-9]([_.-]?[a-z0-9]+)*/[a-z0-9]([_.-]?[a-z0-9]+)*$}i', $information['name'])) {
|
|
|
+ if (!preg_match('{^[a-z0-9]([_.-]?[a-z0-9]+)*/[a-z0-9]([_.-]?[a-z0-9]+)*$}iD', $information['name'])) {
|
|
|
$context->buildViolation('The package name '.htmlentities($information['name'], ENT_COMPAT, 'utf-8').' is invalid, it should have a vendor name, a forward slash, and a package name. The vendor and package name can be words separated by -, . or _. The complete name should match "[a-z0-9]([_.-]?[a-z0-9]+)*/[a-z0-9]([_.-]?[a-z0-9]+)*".')
|
|
|
->atPath($property)
|
|
|
->addViolation()
|
|
@@ -625,7 +625,7 @@ class Package
|
|
|
return;
|
|
|
}
|
|
|
if (null === $this->getName()) {
|
|
|
- $this->setName($information['name']);
|
|
|
+ $this->setName(trim($information['name']));
|
|
|
}
|
|
|
if ($driver instanceof GitHubDriver) {
|
|
|
$this->repository = $driver->getRepositoryUrl();
|