Ticket #23231: 23231.diff
File 23231.diff, 1.2 KB (added by , 9 years ago) |
---|
-
wp-includes/comment.php
1730 1730 * @return int The ID of the comment after adding. 1731 1731 */ 1732 1732 function wp_new_comment( $commentdata ) { 1733 if ( isset( $commentdata['user_ID'] ) ) { 1734 $commentdata['user_id'] = $commentdata['user_ID'] = (int) $commentdata['user_ID']; 1735 } 1736 1733 1737 /** 1734 1738 * Filter a comment's data before it is sanitized and inserted into the database. 1735 1739 * … … 1740 1744 $commentdata = apply_filters( 'preprocess_comment', $commentdata ); 1741 1745 1742 1746 $commentdata['comment_post_ID'] = (int) $commentdata['comment_post_ID']; 1743 if ( isset($commentdata['user_ID']) ) 1744 $commentdata['user_id'] = $commentdata['user_ID'] = (int) $commentdata['user_ID']; 1745 elseif ( isset($commentdata['user_id']) ) 1747 if ( isset( $commentdata['user_id'] ) ) { 1746 1748 $commentdata['user_id'] = (int) $commentdata['user_id']; 1749 } 1747 1750 1748 1751 $commentdata['comment_parent'] = isset($commentdata['comment_parent']) ? absint($commentdata['comment_parent']) : 0; 1749 1752 $parent_status = ( 0 < $commentdata['comment_parent'] ) ? wp_get_comment_status($commentdata['comment_parent']) : '';