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

Improving integer parsing for url parameters #17

Conversation

wcha-peter
Copy link

Sometimes, the id parameter is passed into the [ux_cv_api4_get] as a string, and in this case the is_int check fails, making it impossible to retrieve a specific result.

The new check uses the FILTER_VALIDATE_INT filter, which will correctly categorize integer strings, but can falsely validate some decimal strings as integers.

This one is probably an improvement, as it covers all of the common cases (providing an integer or providing a word), but there might be a more consistent way of validating integers and integer strings.

@agileware-fj
Copy link
Contributor

Couldn't merge this PR since it also introduces an inefficient change to caching - but I've applied your fix.
Thank you.

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

Successfully merging this pull request may close these issues.

2 participants