Avoid validating package name if it has a newline at the end
parent
42e88ac27a
commit
6e6fb844dd
|
@ -214,7 +214,7 @@ EOT
|
|||
}
|
||||
$name = strtolower($name);
|
||||
} else {
|
||||
if (!preg_match('{^[a-z0-9_.-]+/[a-z0-9_.-]+$}', $name)) {
|
||||
if (!preg_match('{^[a-z0-9_.-]+/[a-z0-9_.-]+$}D', $name)) {
|
||||
throw new \InvalidArgumentException(
|
||||
'The package name '.$name.' is invalid, it should be lowercase and have a vendor name, a forward slash, and a package name, matching: [a-z0-9_.-]+/[a-z0-9_.-]+'
|
||||
);
|
||||
|
@ -228,7 +228,7 @@ EOT
|
|||
return $name;
|
||||
}
|
||||
|
||||
if (!preg_match('{^[a-z0-9_.-]+/[a-z0-9_.-]+$}', $value)) {
|
||||
if (!preg_match('{^[a-z0-9_.-]+/[a-z0-9_.-]+$}D', $value)) {
|
||||
throw new \InvalidArgumentException(
|
||||
'The package name '.$value.' is invalid, it should be lowercase and have a vendor name, a forward slash, and a package name, matching: [a-z0-9_.-]+/[a-z0-9_.-]+'
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue