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

isValidInteger validator always return true #23

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

Activity

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

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