WordPress.org

Make WordPress Core

Ticket #22000: 22000.patch

File 22000.patch, 1.2 KB (added by trepmal, 18 months ago)
  • wp-admin/includes/ajax-actions.php

     
    749749        $comment_auto_approved = false; 
    750750        $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type', 'comment_parent', 'user_ID'); 
    751751 
    752         $comment_id = wp_new_comment( $commentdata ); 
    753         $comment = get_comment($comment_id); 
    754         if ( ! $comment ) wp_die( 1 ); 
    755  
    756         $position = ( isset($_POST['position']) && (int) $_POST['position'] ) ? (int) $_POST['position'] : '-1'; 
    757  
    758752        // automatically approve parent comment 
    759753        if ( !empty($_POST['approve_parent']) ) { 
    760754                $parent = get_comment( $comment_parent ); 
     
    765759                } 
    766760        } 
    767761 
     762        $comment_id = wp_new_comment( $commentdata ); 
     763        $comment = get_comment($comment_id); 
     764        if ( ! $comment ) wp_die( 1 ); 
     765 
     766        $position = ( isset($_POST['position']) && (int) $_POST['position'] ) ? (int) $_POST['position'] : '-1'; 
     767 
    768768        ob_start(); 
    769769                if ( 'dashboard' == $_REQUEST['mode'] ) { 
    770770                        require_once( ABSPATH . 'wp-admin/includes/dashboard.php' );