Merge branch '2.2' into 2.3
commit
d70b580899
|
@ -6,7 +6,7 @@
|
||||||
"name": {
|
"name": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "Package name, including 'vendor-name/' prefix.",
|
"description": "Package name, including 'vendor-name/' prefix.",
|
||||||
"pattern": "^[a-z0-9]([_.-]?[a-z0-9]+)*/[a-z0-9](([_.]?|-{0,2})[a-z0-9]+)*$"
|
"pattern": "^[a-z0-9]([_.-]?[a-z0-9]++)*+/[a-z0-9](([_.]|-{1,2})?[a-z0-9]++)*+$"
|
||||||
},
|
},
|
||||||
"description": {
|
"description": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
|
|
@ -456,7 +456,7 @@ class ValidatingArrayLoader implements LoaderInterface
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Preg::isMatch('{^[a-z0-9](?:[_.-]?[a-z0-9]+)*/[a-z0-9](?:(?:[_.]?|-{0,2})[a-z0-9]+)*$}iD', $name)) {
|
if (!Preg::isMatch('{^[a-z0-9](?:[_.-]?[a-z0-9]++)*+/[a-z0-9](?:(?:[_.]|-{1,2})?[a-z0-9]++)*+$}iD', $name)) {
|
||||||
return $name.' 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](([_.]?|-{0,2})[a-z0-9]+)*$".';
|
return $name.' 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](([_.]?|-{0,2})[a-z0-9]+)*$".';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -455,7 +455,8 @@ class ProcessExecutor
|
||||||
// New lines break cmd.exe command parsing
|
// New lines break cmd.exe command parsing
|
||||||
$argument = strtr($argument, "\n", ' ');
|
$argument = strtr($argument, "\n", ' ');
|
||||||
|
|
||||||
$quote = strpbrk($argument, " \t") !== false;
|
// In addition to whitespace, commas need quoting to preserve paths
|
||||||
|
$quote = strpbrk($argument, " \t,") !== false;
|
||||||
$argument = Preg::replace('/(\\\\*)"/', '$1$1\\"', $argument, -1, $dquotes);
|
$argument = Preg::replace('/(\\\\*)"/', '$1$1\\"', $argument, -1, $dquotes);
|
||||||
$meta = $dquotes || Preg::isMatch('/%[^%]+%|![^!]+!/', $argument);
|
$meta = $dquotes || Preg::isMatch('/%[^%]+%|![^!]+!/', $argument);
|
||||||
|
|
||||||
|
|
|
@ -25,9 +25,9 @@ class ComposerSchemaTest extends TestCase
|
||||||
$expectedError = array(
|
$expectedError = array(
|
||||||
array(
|
array(
|
||||||
'property' => 'name',
|
'property' => 'name',
|
||||||
'message' => 'Does not match the regex pattern ^[a-z0-9]([_.-]?[a-z0-9]+)*/[a-z0-9](([_.]?|-{0,2})[a-z0-9]+)*$',
|
'message' => 'Does not match the regex pattern ^[a-z0-9]([_.-]?[a-z0-9]++)*+/[a-z0-9](([_.]|-{1,2})?[a-z0-9]++)*+$',
|
||||||
'constraint' => 'pattern',
|
'constraint' => 'pattern',
|
||||||
'pattern' => '^[a-z0-9]([_.-]?[a-z0-9]+)*/[a-z0-9](([_.]?|-{0,2})[a-z0-9]+)*$',
|
'pattern' => '^[a-z0-9]([_.-]?[a-z0-9]++)*+/[a-z0-9](([_.]|-{1,2})?[a-z0-9]++)*+$',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -179,6 +179,9 @@ class ProcessExecutorTest extends TestCase
|
||||||
// no whitespace must not be quoted
|
// no whitespace must not be quoted
|
||||||
'no-ws' => array('abc', 'abc', "'abc'"),
|
'no-ws' => array('abc', 'abc', "'abc'"),
|
||||||
|
|
||||||
|
// commas must be quoted
|
||||||
|
'comma' => array('a,bc', '"a,bc"', "'a,bc'"),
|
||||||
|
|
||||||
// double-quotes must be backslash-escaped
|
// double-quotes must be backslash-escaped
|
||||||
'dq' => array('a"bc', 'a\^"bc', "'a\"bc'"),
|
'dq' => array('a"bc', 'a\^"bc', "'a\"bc'"),
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue