Changeset 28672
- Timestamp:
- 06/05/2014 04:37:02 AM (11 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-comments-post.php
r27192 r28672 133 133 134 134 $comment_id = wp_new_comment( $commentdata ); 135 $comment = get_comment($comment_id); 135 if ( ! $comment_id ) { 136 wp_die( __( "<strong>ERROR</strong>: The comment could not be saved. Please try again later." ) ); 137 } 138 139 $comment = get_comment( $comment_id ); 136 140 137 141 /** -
trunk/src/wp-includes/comment.php
r28654 r28672 1583 1583 * 1584 1584 * @param array $commentdata Contains information on the comment. 1585 * @return int The new comment's ID.1585 * @return int|bool The new comment's ID on success, false on failure. 1586 1586 */ 1587 1587 function wp_insert_comment( $commentdata ) { … … 1608 1608 1609 1609 $compacted = compact( 'comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_author_IP', 'comment_date', 'comment_date_gmt', 'comment_content', 'comment_karma', 'comment_approved', 'comment_agent', 'comment_type', 'comment_parent', 'user_id' ); 1610 $wpdb->insert( $wpdb->comments, $compacted ); 1610 if ( ! $wpdb->insert( $wpdb->comments, $compacted ) ) { 1611 return false; 1612 } 1611 1613 1612 1614 $id = (int) $wpdb->insert_id; … … 1728 1730 * @since 1.5.0 1729 1731 * @param array $commentdata Contains information on the comment. 1730 * @return int The ID of the comment after adding.1732 * @return int|bool The ID of the comment on success, false on failure. 1731 1733 */ 1732 1734 function wp_new_comment( $commentdata ) { … … 1761 1763 1762 1764 $comment_ID = wp_insert_comment($commentdata); 1765 if ( ! $comment_ID ) { 1766 return false; 1767 } 1763 1768 1764 1769 /**
Note: See TracChangeset
for help on using the changeset viewer.