From 03d69c7662f95def1feb5983f0fbd212755c3705 Mon Sep 17 00:00:00 2001 From: Marcel Voigt Date: Tue, 26 Jan 2016 23:04:10 +0100 Subject: [PATCH] Fix input validation by using only known config values --- src/PHPSemVerChecker/Console/InputMerger.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/PHPSemVerChecker/Console/InputMerger.php b/src/PHPSemVerChecker/Console/InputMerger.php index b7fb249..8a0f6a8 100644 --- a/src/PHPSemVerChecker/Console/InputMerger.php +++ b/src/PHPSemVerChecker/Console/InputMerger.php @@ -23,7 +23,10 @@ public function merge(InputInterface $input, Configuration $config) if ($input->hasArgumentSet($argument)) { $config->set($argument, $value); } else { - $input->setArgument($argument, $config->get($argument)); + $configValue = $config->get($argument); + if ($configValue !== null) { + $input->setArgument($argument, $config->get($argument)); + } } } @@ -31,7 +34,10 @@ public function merge(InputInterface $input, Configuration $config) if ($input->hasOptionSet($option)) { $config->set($option, $value); } else { - $input->setOption($option, $config->get($option)); + $configValue = $config->get($option); + if ($configValue !== null) { + $input->setOption($option, $configValue); + } } } }