#62169 closed defect (bug) (fixed)
Use strict comparison in wp_list_comments()
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 6.7 | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Comments | Keywords: | has-patch |
| Focuses: | coding-standards | Cc: |
Description (last modified by )
A strict comparison should be implemented in the wp-includes/comment-template.php file in wp_list_comments() on line 2291:
if ( $parsed_args['page'] !== $current_cpage || $parsed_args['per_page'] !== $current_per_page ) .
$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.
Attachments (1)
Change History (6)
This ticket was mentioned in PR #7505 on WordPress/wordpress-develop by @deepakrohilla.
16 months ago
#1
#2
@
16 months ago
- Component changed from General to Comments
- Description modified (diff)
- Focuses coding-standards added
- Summary changed from A strict comparison should be implemented in the wp-includes/comment-template.php in wp_list_comments function to Use strict comparison in wp_list_comments()
#3
in reply to:
↑ description
@
16 months ago
- Milestone changed from Awaiting Review to 6.7
Hi there, thanks for the ticket!
Replying to 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.
@SergeyBiryukov commented on PR #7505:
16 months ago
#5
Thanks for the PR! Merged in r59183.
https://core.trac.wordpress.org/ticket/62169