Opened 16 years ago
Closed 16 years ago
#14907 closed defect (bug) (fixed)
Comment type is not correctly passed to wp_notify_postauthor in wp_new_comment()
| Reported by: | solarissmoke | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.1 |
| Component: | Comments | Version: | 3.1 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
Description
Line 1285 of wp-includes/comment.php (part of wp_new_comment) reads as follows:
wp_notify_postauthor($comment_ID, empty( $commentdata['comment_type'] ) ? $commentdata['comment_type'] : '' );
The ternary operation is flawed. If $commentdatacomment_type is empty, then that empty value is returned. If it isn't empty, then an empty string is returned. Either way, an empty value is always passed to wp_notify_postauthor.
I think the check should be !empty() instead. That way a non-empty value is passed properly to the function. Proposed patch attached.
Attachments (1)
Change History (2)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Check for !empty() instead of empty()