Skip to content

Conversation

@mitchierichie
Copy link

Q A
Bug fix? yes
New feature? no
BC breaks? no
Related Issue Fix #223
Need Doc update no

Describe your change

Check if a string that was cast to a number is NaN or INF and don't store it in the transformed array.

What problem is this fixing?

Converting all numeric strings, is causing errors when a numeric string casts as a float to INF or NaN. This causes this package to crash the app. These attributes should just be left as strings.

Here's an example:

is_numeric('5929e536'); // true
(float) '5929e536'; // INF

@jakew009
Copy link

Thanks for fixing this

@mitchierichie
Copy link
Author

Thanks for fixing this

Hopefully it gets merged!!! 🥳

@DevinCodes DevinCodes self-requested a review June 4, 2025 07:41
Copy link
Contributor

@DevinCodes DevinCodes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @mitchierichie ,

Thank you for the PR. Would you mind adding a quick unit test for this behaviour, please?

@mitchierichie
Copy link
Author

will do @DevinCodes

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

Successfully merging this pull request may close these issues.

Importing certain strings causes json_encode error

3 participants