Skip to content

[9.x] Trims numeric validation values / parameters - #45912

Merged
taylorotwell merged 12 commits into
laravel:9.xfrom
timacdonald:trim
Feb 2, 2023
Merged

taylorotwell merged 12 commits into
laravel:9.xfrom
timacdonald:trim

Conversation

@timacdonald

@timacdonald timacdonald commented Feb 2, 2023 •

Copy link
Copy Markdown
Member

With the introduction of brick/math to handle the numeric validation rules, we had a slight regression. Previously values were cast to int or float by PHP. When PHP does this it trims any whitespace.

'\n 5 ' > 5

// same as

5 > 5

brick/math will throw an exception if the value contains whitespace. To restore the previous functionality we are now trimming the value and parameters where suitable.

This regression was raised in #45762 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants