Merge pull request #390 from skipperbent/v4-development

Fixed defaultValue issue in `getValue` method in `InputHandler` class.
This commit is contained in:
Simon Sessingø
2018-03-29 21:45:26 +02:00
committed by GitHub
+1 -6
View File
@@ -244,12 +244,7 @@ class InputHandler
public function getValue(string $index, ?string $defaultValue = null, ...$methods): ?string
{
$input = $this->get($index, $methods);
if ($input !== null) {
return (trim($input->getValue()) === '') ? $defaultValue : $input->getValue();
}
return $input;
return ($input === null || ($input !== null && trim($input->getValue()) === '')) ? $defaultValue : $input->getValue();
}
/**