Skip to content

[BUG]: Numericality allows spaces #16461

Closed
Closed
@krazzer

Description

@krazzer

Describe the bug
The Numericality allows spaces when validating

To Reproduce
Create a field with a Numericality validator. Type "1 " and it will pass

Expected behavior
I would expect this would not pass.

Details

  • Phalcon version: 5.4.0
  • PHP Version: 8.2

Additional context
I have a number field in my form, that eventually will be stored in the DB as a number. The input is validated using Numericality, because it must be a number. Something like "1 " or "1 1" passes with Numericality. And then I get an error from the DB because it's not a valid number. So then I would have to write extra logic for it to work.

Metadata

Metadata

Assignees

Labels

5.0The issues we want to solve in the 5.0 releasebugA bug reportstatus: mediumMedium

Type

Projects

Status

Released

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions