mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-06-17 00:37:52 +00:00
Fixed defaultValue issue in getValue method in InputHandler class.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user