Changeset 28427
- Timestamp:
- 05/15/2014 06:36:17 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/comment.php
r28324 r28427 1806 1806 // First, get all of the original fields 1807 1807 $comment = get_comment($commentarr['comment_ID'], ARRAY_A); 1808 if ( empty( $comment ) ) 1808 if ( empty( $comment ) ) { 1809 1809 return 0; 1810 1810 } 1811 1811 // Escape data pulled from DB. 1812 1812 $comment = wp_slash($comment); … … 1820 1820 1821 1821 // Now extract the merged array. 1822 extract(wp_unslash($commentarr), EXTR_SKIP);1822 $data = wp_unslash( $commentarr ); 1823 1823 1824 1824 /** … … 1829 1829 * @param string $comment_content The comment data. 1830 1830 */ 1831 $comment_content = apply_filters( 'comment_save_pre', $comment_content ); 1832 1833 $comment_date_gmt = get_gmt_from_date($comment_date); 1834 1835 if ( !isset($comment_approved) ) 1836 $comment_approved = 1; 1837 else if ( 'hold' == $comment_approved ) 1838 $comment_approved = 0; 1839 else if ( 'approve' == $comment_approved ) 1840 $comment_approved = 1; 1841 1842 $data = compact( 'comment_content', 'comment_author', 'comment_author_email', 'comment_approved', 'comment_karma', 'comment_author_url', 'comment_date', 'comment_date_gmt', 'comment_parent' ); 1831 $data['comment_content'] = apply_filters( 'comment_save_pre', $data['comment_content'] ); 1832 1833 $data['comment_date_gmt'] = get_gmt_from_date( $data['comment_date'] ); 1834 1835 if ( ! isset( $data['comment_approved'] ) ) { 1836 $data['comment_approved'] = 1; 1837 } else if ( 'hold' == $data['comment_approved'] ) { 1838 $data['comment_approved'] = 0; 1839 } else if ( 'approve' == $data['comment_approved'] ) { 1840 $data['comment_approved'] = 1; 1841 } 1842 1843 $comment_ID = $data['comment_ID']; 1844 $comment_post_ID = $data['comment_post_ID']; 1845 $keys = array( 'comment_content', 'comment_author', 'comment_author_email', 'comment_approved', 'comment_karma', 'comment_author_url', 'comment_date', 'comment_date_gmt', 'comment_parent' ); 1846 $data = wp_array_slice_assoc( $data, $keys ); 1843 1847 $rval = $wpdb->update( $wpdb->comments, $data, compact( 'comment_ID' ) ); 1844 1848 1845 clean_comment_cache( $comment_ID);1846 wp_update_comment_count( $comment_post_ID);1849 clean_comment_cache( $comment_ID ); 1850 wp_update_comment_count( $comment_post_ID ); 1847 1851 /** 1848 1852 * Fires immediately after a comment is updated in the database.
Note: See TracChangeset
for help on using the changeset viewer.