Home
Documentation
Downloads
Demo
Tracker
Development
Translation
Moodle.net
Search
projects
/
moodle.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6d138e3
)
MDL-70131 cli: only allow to negate existing keys
author
Marina Glancy
<marina@moodle.com>
Thu, 5 Nov 2020 17:10:13 +0000
(18:10 +0100)
committer
Andrew Nicols
<andrew@nicols.co.uk>
Fri, 6 Nov 2020 01:30:08 +0000
(09:30 +0800)
lib/clilib.php
patch
|
blob
|
blame
|
history
diff --git
a/lib/clilib.php
b/lib/clilib.php
index
f43bf8f
..
e6664cd
100644
(file)
--- a/
lib/clilib.php
+++ b/
lib/clilib.php
@@
-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);