[wp-trac] [WordPress Trac] #62169: Use strict comparison in wp_list_comments()

WordPress Trac noreply at wordpress.org
Sun Oct 6 16:52:32 UTC 2024


#62169: Use strict comparison in wp_list_comments()
---------------------------+-------------------------------
 Reporter:  deepakrohilla  |       Owner:  deepakrohilla
     Type:  defect (bug)   |      Status:  assigned
 Priority:  normal         |   Milestone:  6.7
Component:  Comments       |     Version:
 Severity:  normal         |  Resolution:
 Keywords:  has-patch      |     Focuses:  coding-standards
---------------------------+-------------------------------
Changes (by SergeyBiryukov):

 * milestone:  Awaiting Review => 6.7


Comment:

 Hi there, thanks for the ticket!

 Replying to [ticket:62169 deepakrohilla]:
 > `$parsed_args['page']` and `$current_cpage`, as well as
 `$parsed_args['per_page']` and `$current_per_page`, both return integer
 values. I have not observed any of these variables returning a different
 return type.

 In my testing, both `$current_cpage` and `$current_per_page` are actually
 a string here, as returned by `get_query_var()`. Technically
 `$parsed_args['page']` and `$parsed_args['per_page']` can be a string too,
 depending on the type that was passed in, so this would need type casting
 on both sides for correct comparison.

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


More information about the wp-trac mailing list