MDL-70131 cli: only allow to negate existing keys
This commit is contained in:
committed by
Andrew Nicols
parent
6d138e3675
commit
8a9a4ee4f3
+2
-1
@@ -106,7 +106,8 @@ function cli_get_params(array $longoptions, array $shortmapping=null) {
|
||||
$key = reset($parts);
|
||||
$value = true;
|
||||
|
||||
if (substr($key, 0, 3) === 'no-') {
|
||||
if (substr($key, 0, 3) === 'no-' && !array_key_exists($key, $longoptions)
|
||||
&& array_key_exists(substr($key, 3), $longoptions)) {
|
||||
// Support flipping the boolean value.
|
||||
$value = !$value;
|
||||
$key = substr($key, 3);
|
||||
|
||||
Reference in New Issue
Block a user