« Previous | Next » 

Revision a9156475

IDa915647549a52621d1b23b7787f0bd2e03a91261

Added by Bastian Waidelich over 9 years ago

[!!!][BUGFIX] Float and Integer converters do not correctly handle errors and empty values

When an argument of a controller action is annotated with
@param integer $var, the validation never fails if a string
is passed to the argument.
This is because the IntegerConverter implicitly casts the
string to an integer. The same problem exists with floats.

This change fixes this by checking the value and returning
an error object if it is not numeric. Besides this tweaks
the FloatConverter to accept float and integer values as
input and it adds a bunch of unit & functional tests.

Furthermore, empty strings are now correctly converted as NULL values.
This is a breaking change if you relied upon the old behavior that
empty values are converted to the number 0.

Change-Id: I178f616d0dd4acea90938384fb21600dd0f7c252
Fixes: #35136
Releases: 1.1, 1.2

  • added
  • modified
  • copied
  • renamed
  • deleted