[wp-trac] [WordPress Trac] #63975: wp_delete_auto_drafts passes post ID as string instead of as int
WordPress Trac
noreply at wordpress.org
Tue Sep 16 13:43:44 UTC 2025
#63975: wp_delete_auto_drafts passes post ID as string instead of as int
-----------------------------------------+------------------------------
Reporter: kkmuffme | Owner: kkmuffme
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: Awaiting Review
Component: Posts, Post Types | Version: 3.4
Severity: trivial | Resolution:
Keywords: has-patch changes-requested | Focuses:
-----------------------------------------+------------------------------
Comment (by SirLouen):
Replying to [comment:9 kkmuffme]:
> This is wrong. INT (or BIGINT) is always a (numeric-)string when using
mysql in PHP on unix.
It's technically wrong (hence your strict typing alert or probably most
static analyzers), but not conceptually wrong given that this is only
going to receive an array of a very particular case of numerical strings
like incremental and mandatory BIGINT IDs, so it's impossible that this
can possibly fail.
Being sincere, I'm sure of what the general opinion is on these topics;
there are probably a couple hundred like this (and they will keep rising
as this is not strongly typed). I'm going to raise it in the next dev
chat, would like to hear from others.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/63975#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list