Changeset 23554 for trunk/wp-admin/includes/comment.php
- Timestamp:
- 03/01/2013 04:28:40 PM (13 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/includes/comment.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/comment.php
r23433 r23554 20 20 global $wpdb; 21 21 22 $comment_author = stripslashes($comment_author); 23 $comment_date = stripslashes($comment_date); 24 22 25 return $wpdb->get_var( $wpdb->prepare("SELECT comment_post_ID FROM $wpdb->comments 23 26 WHERE comment_author = %s AND comment_date = %s", $comment_author, $comment_date) ); … … 31 34 function edit_comment() { 32 35 33 $post_data = wp_unslash( $_POST ); 34 35 if ( ! current_user_can( 'edit_comment', (int) $post_data['comment_ID'] ) ) 36 if ( ! current_user_can( 'edit_comment', (int) $_POST['comment_ID'] ) ) 36 37 wp_die ( __( 'You are not allowed to edit comments on this post.' ) ); 37 38 38 $ post_data['comment_author'] = $post_data['newcomment_author'];39 $ post_data['comment_author_email'] = $post_data['newcomment_author_email'];40 $ post_data['comment_author_url'] = $post_data['newcomment_author_url'];41 $ post_data['comment_approved'] = $post_data['comment_status'];42 $ post_data['comment_content'] = $post_data['content'];43 $ post_data['comment_ID'] = (int) $post_data['comment_ID'];39 $_POST['comment_author'] = $_POST['newcomment_author']; 40 $_POST['comment_author_email'] = $_POST['newcomment_author_email']; 41 $_POST['comment_author_url'] = $_POST['newcomment_author_url']; 42 $_POST['comment_approved'] = $_POST['comment_status']; 43 $_POST['comment_content'] = $_POST['content']; 44 $_POST['comment_ID'] = (int) $_POST['comment_ID']; 44 45 45 46 foreach ( array ('aa', 'mm', 'jj', 'hh', 'mn') as $timeunit ) { 46 if ( !empty( $ post_data['hidden_' . $timeunit] ) && $post_data['hidden_' . $timeunit] != $post_data[$timeunit] ) {47 if ( !empty( $_POST['hidden_' . $timeunit] ) && $_POST['hidden_' . $timeunit] != $_POST[$timeunit] ) { 47 48 $_POST['edit_date'] = '1'; 48 49 break; … … 50 51 } 51 52 52 if ( !empty ( $ post_data['edit_date'] ) ) {53 $aa = $ post_data['aa'];54 $mm = $ post_data['mm'];55 $jj = $ post_data['jj'];56 $hh = $ post_data['hh'];57 $mn = $ post_data['mn'];58 $ss = $ post_data['ss'];53 if ( !empty ( $_POST['edit_date'] ) ) { 54 $aa = $_POST['aa']; 55 $mm = $_POST['mm']; 56 $jj = $_POST['jj']; 57 $hh = $_POST['hh']; 58 $mn = $_POST['mn']; 59 $ss = $_POST['ss']; 59 60 $jj = ($jj > 31 ) ? 31 : $jj; 60 61 $hh = ($hh > 23 ) ? $hh -24 : $hh; 61 62 $mn = ($mn > 59 ) ? $mn -60 : $mn; 62 63 $ss = ($ss > 59 ) ? $ss -60 : $ss; 63 $ post_data['comment_date'] = "$aa-$mm-$jj $hh:$mn:$ss";64 $_POST['comment_date'] = "$aa-$mm-$jj $hh:$mn:$ss"; 64 65 } 65 66 66 wp_update_comment( $ post_data);67 wp_update_comment( $_POST ); 67 68 } 68 69
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)