[wp-trac] [WordPress Trac] #48027: WP_Comment fields (e.g. user_id) have wrong types

WordPress Trac noreply at wordpress.org
Fri Sep 13 03:23:02 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):

 Thanks for the references @SergeyBiryukov. I'll look into them. Actually
 backward compatibility is one of my reservation regarding this as well.
 But I think it still best to address this issue one way or the other. From
 the DocBlock of `WP_Comment` it states `user_id` as `int`.
 https://core.trac.wordpress.org/browser/tags/5.2/src/wp-includes/class-wp-
 comment.php#L133

 I suppose for the meantime, it's possible to change it to `string` with a
 description stating that it's a `numerical value`. Just to prevent
 confusion. But it's best if we can try to see if we can transform it to
 `int`.

 For the meantime, i'll try to find possible areas affected with this
 change.

 If anyone is available, please feel free to try this out as well. The more
 test cases, the better. Thanks guys.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/48027#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list