[wp-trac] [WordPress Trac] #60475: Possible incorrect type for $comment_id in get_comment_author filter
WordPress Trac
noreply at wordpress.org
Thu Feb 8 15:44:40 UTC 2024
#60475: Possible incorrect type for $comment_id in get_comment_author filter
--------------------------+-----------------------------
Reporter: david.binda | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Comments | Version: 6.0
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
After r52818 the `$comment_id` param of the `get_comment_author` filter,
which is [https://core.trac.wordpress.org/browser/trunk/src/wp-includes
/comment-template.php?rev=56687#L47 documented as numeric string], may be
an `int`, in case a non-existing comment ID is passed to the
`get_comment_author` function.
The topic has been briefly discussed in
https://core.trac.wordpress.org/ticket/54379#comment:8 mentioning that the
numeric string type is here for compatibility.
I'm attaching a patch containing a fix for the issue, as well as a PHPUnit
test demonstrating the behaviour.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/60475>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list