Ticket #30307: 30307.patch
File 30307.patch, 2.0 KB (added by , 10 years ago) |
---|
-
src/wp-admin/includes/comment.php
37 37 if ( ! current_user_can( 'edit_comment', (int) $_POST['comment_ID'] ) ) 38 38 wp_die ( __( 'You are not allowed to edit comments on this post.' ) ); 39 39 40 $comment_data = array(); 41 40 42 if ( isset( $_POST['newcomment_author'] ) ) 41 $ _POST['comment_author'] = $_POST['newcomment_author'];43 $comment_data['comment_author'] = $_POST['newcomment_author']; 42 44 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']; 44 46 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']; 46 48 if ( isset( $_POST['comment_status'] ) ) 47 $ _POST['comment_approved'] = $_POST['comment_status'];49 $comment_data['comment_approved'] = $_POST['comment_status']; 48 50 if ( isset( $_POST['content'] ) ) 49 $ _POST['comment_content'] = $_POST['content'];51 $comment_data['comment_content'] = $_POST['content']; 50 52 if ( isset( $_POST['comment_ID'] ) ) 51 $ _POST['comment_ID'] = (int) $_POST['comment_ID'];53 $comment_data['comment_ID'] = (int) $_POST['comment_ID']; 52 54 53 55 foreach ( array ('aa', 'mm', 'jj', 'hh', 'mn') as $timeunit ) { 54 56 if ( !empty( $_POST['hidden_' . $timeunit] ) && $_POST['hidden_' . $timeunit] != $_POST[$timeunit] ) { 55 $ _POST['edit_date'] = '1';57 $comment_data['edit_date'] = '1'; 56 58 break; 57 59 } 58 60 } … … 68 70 $hh = ($hh > 23 ) ? $hh -24 : $hh; 69 71 $mn = ($mn > 59 ) ? $mn -60 : $mn; 70 72 $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"; 72 74 } 73 75 74 wp_update_comment( $ _POST);76 wp_update_comment( $comment_data ); 75 77 } 76 78 77 79 /**