Make WordPress Core

Ticket #34141: 34141.2.2.diff

File 34141.2.2.diff, 1.2 KB (added by dshanske, 9 years ago)

Correction - Should be Array_Diff_key

  • class-wp-xmlrpc-server.php

     
    62626262                $this->escape($comment_content);
    62636263                $comment_type = 'pingback';
    62646264
    6265                 $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_url', 'comment_author_email', 'comment_content', 'comment_type');
     6265                $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_url', 'comment_author_email', 'comment_content', 'comment_type', 'linea' );
    62666266
    62676267                $comment_ID = wp_new_comment($commentdata);
    62686268
  • comment-functions.php

     
    14291429         * @param WP_Comment $comment Comment object.
    14301430         */
    14311431        do_action( 'wp_insert_comment', $id, $comment );
     1432       
     1433        // If there is something extra in $commentdata save it as meta.
     1434        $commentmeta = array_diff_key( $commentdata, $compacted );
     1435        foreach ( $commentmeta as $key => $value ) {
     1436                update_comment_meta( $id, $key, $value, true );
     1437        }
    14321438
    14331439        wp_cache_set( 'last_changed', microtime(), 'comment' );
    14341440