Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integer function allows non-integers #7

Open
JamoCA opened this issue Oct 4, 2018 · 0 comments
Open

Integer function allows non-integers #7

JamoCA opened this issue Oct 4, 2018 · 0 comments

Comments

@JamoCA
Copy link

JamoCA commented Oct 4, 2018

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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant