-
-
Notifications
You must be signed in to change notification settings - Fork 116
Closed
Description
Version: 2.4.12
Bug Description
There is a problem when converting float GET params in \Nette\Application\UI\ComponentReflection::convertType(). Because conversion from string to float and back does not have to give the same result, in some cases it ends up with the data-loss check.
Steps To Reproduce
class FooPresenter extends \Nette\Application\UI\Presenter {
public function actionBar(float $length) {
}
}When you call /foo/bar/?length=1.2 everything work as expected.
When you call /foo/bar/?length=1.0 the BadRequestException is thrown.
Expected Behavior
Value 1.0 should be treated as float not string.
Possible Solution
I was not able to find out other solution then handle each scalar type differently.
Metadata
Metadata
Assignees
Labels
No labels