Compare commits

...

2 Commits

Author SHA1 Message Date
Simon Sessingø 555afd04f1 Merge pull request #390 from skipperbent/v4-development
Fixed defaultValue issue in `getValue` method in `InputHandler` class.
2018-03-29 21:45:26 +02:00
Simon Sessingø e6db83c97a Fixed defaultValue issue in getValue method in InputHandler class. 2018-03-29 21:44:41 +02:00
+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();
}
/**