[wp-trac] [WordPress Trac] #48027: WP_Comment fields (e.g. user_id) have wrong types
WordPress Trac
noreply at wordpress.org
Fri Sep 13 01:39:18 UTC 2019
#48027: WP_Comment fields (e.g. user_id) have wrong types
--------------------------+------------------------------
Reporter: cneumann | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Comments | Version: 5.2.3
Severity: minor | Resolution:
Keywords: | Focuses:
--------------------------+------------------------------
Comment (by donmhico):
I've attached a new patch
[https://core.trac.wordpress.org/attachment/ticket/48027/48027.1.diff
48027.1.diff], that basically change the `user_id` property to `int`
before the comment object is returned. Although i'm not if this is good
enough. Its also possible to convert it to `int` before it is added to
cache using `wp_cache_add`. Let me know your thoughts.
I've added some unit tests and as well as change some existing ones to
reflect the change. It might be good to create a `dev-note` regarding this
as existing themes / plugins might be using `===` before and those will
break since the patch will change the `user_id` from `string` to `int`.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/48027#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list