Skip to content

Integer function allows non-integers #7

@JamoCA

Description

@JamoCA

I noticed there was an "integer" udf in the securityutil CFC. I couldn't find any reference to it being used by the library, but if it is please consider using the following condition to determine whether the value is an integer or not... otherwise post-validation errors could occur when passing values that exceed allowable integer limits.

function isInteger(num){
    return isSimpleValue(num) AND refind("^-?\d+$", num) AND VAL(num) LTE 2147483647 AND VAL(num) GTE -2147483648;
}

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