Make WordPress Core

Ticket #30307: 30307.patch

File 30307.patch, 2.0 KB (added by SergeyBiryukov, 10 years ago)
  • src/wp-admin/includes/comment.php

     
    3737        if ( ! current_user_can( 'edit_comment', (int) $_POST['comment_ID'] ) )
    3838                wp_die ( __( 'You are not allowed to edit comments on this post.' ) );
    3939
     40        $comment_data = array();
     41
    4042        if ( isset( $_POST['newcomment_author'] ) )
    41                 $_POST['comment_author'] = $_POST['newcomment_author'];
     43                $comment_data['comment_author'] = $_POST['newcomment_author'];
    4244        if ( isset( $_POST['newcomment_author_email'] ) )
    43                 $_POST['comment_author_email'] = $_POST['newcomment_author_email'];
     45                $comment_data['comment_author_email'] = $_POST['newcomment_author_email'];
    4446        if ( isset( $_POST['newcomment_author_url'] ) )
    45                 $_POST['comment_author_url'] = $_POST['newcomment_author_url'];
     47                $comment_data['comment_author_url'] = $_POST['newcomment_author_url'];
    4648        if ( isset( $_POST['comment_status'] ) )
    47                 $_POST['comment_approved'] = $_POST['comment_status'];
     49                $comment_data['comment_approved'] = $_POST['comment_status'];
    4850        if ( isset( $_POST['content'] ) )
    49                 $_POST['comment_content'] = $_POST['content'];
     51                $comment_data['comment_content'] = $_POST['content'];
    5052        if ( isset( $_POST['comment_ID'] ) )
    51                 $_POST['comment_ID'] = (int) $_POST['comment_ID'];
     53                $comment_data['comment_ID'] = (int) $_POST['comment_ID'];
    5254
    5355        foreach ( array ('aa', 'mm', 'jj', 'hh', 'mn') as $timeunit ) {
    5456                if ( !empty( $_POST['hidden_' . $timeunit] ) && $_POST['hidden_' . $timeunit] != $_POST[$timeunit] ) {
    55                         $_POST['edit_date'] = '1';
     57                        $comment_data['edit_date'] = '1';
    5658                        break;
    5759                }
    5860        }
     
    6870                $hh = ($hh > 23 ) ? $hh -24 : $hh;
    6971                $mn = ($mn > 59 ) ? $mn -60 : $mn;
    7072                $ss = ($ss > 59 ) ? $ss -60 : $ss;
    71                 $_POST['comment_date'] = "$aa-$mm-$jj $hh:$mn:$ss";
     73                $comment_data['comment_date'] = "$aa-$mm-$jj $hh:$mn:$ss";
    7274        }
    7375
    74         wp_update_comment( $_POST );
     76        wp_update_comment( $comment_data );
    7577}
    7678
    7779/**