diff --git a/src/Pecee/Http/Input/InputHandler.php b/src/Pecee/Http/Input/InputHandler.php index 9b15a2a..051a187 100644 --- a/src/Pecee/Http/Input/InputHandler.php +++ b/src/Pecee/Http/Input/InputHandler.php @@ -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(); } /**