Changeset 9098 for trunk/wp-admin/admin-ajax.php
- Timestamp:
- 10/08/2008 01:18:16 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-ajax.php
r9083 r9098 445 445 $comment_author_email = $wpdb->escape($user->user_email); 446 446 $comment_author_url = $wpdb->escape($user->user_url); 447 $comment_content = trim($_POST['co mment']);447 $comment_content = trim($_POST['content']); 448 448 if ( current_user_can('unfiltered_html') ) { 449 449 if ( wp_create_nonce('unfiltered-html-comment_' . $comment_post_ID) != $_POST['_wp_unfiltered_html_comment'] ) { … … 482 482 $x->add( array( 483 483 'what' => 'comment', 484 'id' => $comment->comment_ID, 485 'data' => $comment_list_item, 486 'position' => $position 487 )); 488 489 $x->send(); 490 break; 491 case 'edit-comment' : 492 check_ajax_referer( 'replyto-comment' ); 493 494 $comment_post_ID = (int) $_POST['comment_post_ID']; 495 if ( ! current_user_can( 'edit_post', $comment_post_ID ) ) 496 die('-1'); 497 498 if ( '' == $_POST['content'] ) 499 die( __('Error: please type a comment.') ); 500 501 $comment_id = (int) $_POST['comment_ID']; 502 $_POST['comment_status'] = $_POST['status']; 503 edit_comment(); 504 505 $mode = ( isset($_POST['mode']) && 'single' == $_POST['mode'] ) ? 'single' : 'detail'; 506 $position = ( isset($_POST['position']) && (int) $_POST['position']) ? (int) $_POST['position'] : '-1'; 507 $checkbox = ( isset($_POST['checkbox']) && true == $_POST['checkbox'] ) ? 1 : 0; 508 509 if ( get_option('show_avatars') && 'single' != $mode ) 510 add_filter( 'comment_author', 'floated_admin_avatar' ); 511 512 $x = new WP_Ajax_Response(); 513 514 ob_start(); 515 _wp_comment_row( $comment_id, $mode, false, $checkbox ); 516 $comment_list_item = ob_get_contents(); 517 ob_end_clean(); 518 519 $x->add( array( 520 'what' => 'edit_comment', 484 521 'id' => $comment->comment_ID, 485 522 'data' => $comment_list_item,
Note: See TracChangeset
for help on using the changeset viewer.