[wp-trac] [WordPress Trac] #65271: REST API Integer Type Check Fails on Large Ints
WordPress Trac
noreply at wordpress.org
Thu May 21 05:02:29 UTC 2026
#65271: REST API Integer Type Check Fails on Large Ints
--------------------------------------+--------------------------
Reporter: kevinfodness | Owner: westonruter
Type: defect (bug) | Status: reviewing
Priority: normal | Milestone: 7.1
Component: REST API | Version: 5.5
Severity: minor | Resolution:
Keywords: has-patch has-unit-tests | Focuses:
--------------------------------------+--------------------------
Comment (by gautam23):
Makes sense. While I don't think we should technically support scientific
notation since this is a REST API integer validator and not a general
purpose integer validator, but yeah...I get the point about preserving
existing behavior.
So, I’ve updated my PR to also support scientific notation values that
represent integers (for example 1e3) while still avoiding float conversion
entirely. I think that gets the best of both approaches: preserving
existing behavior where it makes sense, while keeping the validation logic
deterministic and free from float precision issues.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/65271#comment:22>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list