Changeset 32364 for trunk/src/wp-includes/comment.php
- Timestamp:
- 05/06/2015 02:59:50 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/comment.php
r32116 r32364 2119 2119 $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' ); 2120 2120 if ( ! $wpdb->insert( $wpdb->comments, $compacted ) ) { 2121 $fields = array( 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content' ); 2122 2123 foreach( $fields as $field ) { 2124 if ( isset( $compacted[ $field ] ) ) { 2125 $compacted[ $field ] = $wpdb->strip_invalid_text_for_column( $wpdb->comments, $field, $compacted[ $field ] ); 2126 } 2127 } 2128 2129 if ( ! $wpdb->insert( $wpdb->comments, $compacted ) ) { 2130 return false; 2131 } 2121 return false; 2132 2122 } 2133 2123 … … 2253 2243 */ 2254 2244 function wp_new_comment( $commentdata ) { 2245 global $wpdb; 2246 2255 2247 if ( isset( $commentdata['user_ID'] ) ) { 2256 2248 $commentdata['user_id'] = $commentdata['user_ID'] = (int) $commentdata['user_ID']; … … 2296 2288 $comment_ID = wp_insert_comment($commentdata); 2297 2289 if ( ! $comment_ID ) { 2298 return false; 2290 $fields = array( 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content' ); 2291 2292 foreach( $fields as $field ) { 2293 if ( isset( $commentdata[ $field ] ) ) { 2294 $commentdata[ $field ] = $wpdb->strip_invalid_text_for_column( $wpdb->comments, $field, $commentdata[ $field ] ); 2295 } 2296 } 2297 2298 $commentdata = wp_filter_comment( $commentdata ); 2299 2300 $commentdata['comment_approved'] = wp_allow_comment( $commentdata ); 2301 2302 $comment_ID = wp_insert_comment( $commentdata ); 2303 if ( ! $comment_ID ) { 2304 return false; 2305 } 2299 2306 } 2300 2307
Note: See TracChangeset
for help on using the changeset viewer.