Skip to content

Gte/Lte/Lt/Gt incorrectly treat strings as numeric? #40308

Closed
@sparxooo

Description

@sparxooo
  • Laravel Version: 8.75.
  • PHP Version: 8.1.1

Description:

When validating strings using Gte/Gt/Lte/Lt, as per the Laravel docs, it should count characters in strings, as per the size validator.

When validating "password" using rule "gte:8" it will fail
When validating "8" using rule "gte:8" it will pass
When validating "7" using rule "gte:8" it will fail
When validating "9" using rule "gte:8" it will pass

Size works correctly:

When validating "password" using rule "size:8" it will pass
When validating "8" using rule "size:8" it will fail

If i'm doing it wrong, I apologise!

Steps To Reproduce:

Validate a string with lte/lt/gt/gte to match lengths

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions