Skip to content
This repository was archived by the owner on Apr 6, 2021. It is now read-only.

isValidInteger validator always return true #23

@dod38fr

Description

@dod38fr

The following call returns true instead of false:

 esapi.validator().isValidInteger("Integer", 500, false, 1, 99);

The problem comes from:

  • DefaultValidator.isValidInteger calls DefaultValidator.getValidInteger
  • DefaultValidator.getValidInteger calls BaseValidationRule.getValid
  • getValid calls getValidInput, but all validation exceptions are catched to call this.sanitize which returns the input instead of false, hence isValidInteger always return true

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