mirror of
git://develop.git.wordpress.org/
synced 2025-03-29 08:12:35 +01:00
This aims to resolve a fatal error when the incoming `$comment_id` is an instance of `WP_Comment` (or any object) without a `comment_ID` property defined, or if it's empty: {{{ Object of class WP_Comment could not be converted to string }}} This commit mirrors the changes previously made for a similar code fragment in `get_comment_author()`. Includes: * Unit tests to demonstrate the fatal error and validate the fix. * Changing the default value for a non-existent comment ID in `get_comment_author()` from an empty string to zero as a numeric string, for consistency with `get_comment_ID()`. Follow-up to [52818], [55289], [58335], [58755]. Props narenin, mukesh27, iflairwebtechnologies, umeshsinghin, SergeyBiryukov. Fixes #61715. git-svn-id: https://develop.svn.wordpress.org/trunk@58809 602fd350-edb4-49c9-b593-d223f7449a82