Skip to content

Conversation

@taka-oyama
Copy link
Contributor

@taka-oyama taka-oyama commented Mar 27, 2023

ParseHelper::convertToNumber was returning floats for negatives integers when it should have been returning int.

if (ctype_digit($text) && (float) $text === (float) ((int) $text)) {

This is because ctype_digit returns false for negative numbers.

So I have change the method to use filter_var($text, FILTER_VALIDATE_INT) instead.

@taka-oyama taka-oyama changed the title fix: negative numbers had the wrong type fix: negative numbers return the wrong type Mar 27, 2023
@taka-oyama
Copy link
Contributor Author

@gonzofy @MAXakaWIZARD

Would it be possible to take a look at this and possibly get it merged (and released)?

@gonzofy gonzofy merged commit 6f1a5d4 into salsify:master Apr 14, 2023
@gonzofy
Copy link
Contributor

gonzofy commented Apr 14, 2023

@taka-oyama done. thanks for the reminder.

@taka-oyama taka-oyama mentioned this pull request May 8, 2023
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.

2 participants