Make WordPress Core


Ignore:
Timestamp:
03/01/2013 04:28:40 PM (12 years ago)
Author:
ryan
Message:

Revert 23416, 23419, 23445 except for wp_reset_vars() changes. We are going a different direction with the slashing cleanup, so resetting to a clean slate. see #21767

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-comments-post.php

    r23416 r23554  
    1818nocache_headers();
    1919
    20 $post_data = wp_unslash( $_POST );
    21 
    22 $comment_post_ID = isset($post_data['comment_post_ID']) ? (int) $post_data['comment_post_ID'] : 0;
     20$comment_post_ID = isset($_POST['comment_post_ID']) ? (int) $_POST['comment_post_ID'] : 0;
    2321
    2422$post = get_post($comment_post_ID);
     
    5048}
    5149
    52 $comment_author       = ( isset( $post_data['author'] ) )  ? trim( strip_tags( $post_data['author'] ) ) : null;
    53 $comment_author_email = ( isset( $post_data['email'] ) )   ? trim( $post_data['email'] ) : null;
    54 $comment_author_url   = ( isset( $post_data['url'] ) )     ? trim( $post_data['url'] ) : null;
    55 $comment_content      = ( isset( $post_data['comment'] ) ) ? trim( $post_data['comment'] ) : null;
     50$comment_author       = ( isset($_POST['author']) )  ? trim(strip_tags($_POST['author'])) : null;
     51$comment_author_email = ( isset($_POST['email']) )   ? trim($_POST['email']) : null;
     52$comment_author_url   = ( isset($_POST['url']) )     ? trim($_POST['url']) : null;
     53$comment_content      = ( isset($_POST['comment']) ) ? trim($_POST['comment']) : null;
    5654
    5755// If the user is logged in
     
    5957if ( $user->exists() ) {
    6058    if ( empty( $user->display_name ) )
    61         $user->display_name = $user->user_login;
    62     $comment_author       = $user->display_name;
    63     $comment_author_email = $user->user_email;
    64     $comment_author_url   = $user->user_url;
     59        $user->display_name=$user->user_login;
     60    $comment_author       = $wpdb->escape($user->display_name);
     61    $comment_author_email = $wpdb->escape($user->user_email);
     62    $comment_author_url   = $wpdb->escape($user->user_url);
    6563    if ( current_user_can('unfiltered_html') ) {
    66         if ( wp_create_nonce('unfiltered-html-comment_' . $comment_post_ID) != $post_data['_wp_unfiltered_html_comment'] ) {
     64        if ( wp_create_nonce('unfiltered-html-comment_' . $comment_post_ID) != $_POST['_wp_unfiltered_html_comment'] ) {
    6765            kses_remove_filters(); // start with a clean slate
    6866            kses_init_filters(); // set up the filters
     
    8684    wp_die( __('<strong>ERROR</strong>: please type a comment.') );
    8785
    88 $comment_parent = isset($post_data['comment_parent']) ? absint($post_data['comment_parent']) : 0;
     86$comment_parent = isset($_POST['comment_parent']) ? absint($_POST['comment_parent']) : 0;
    8987
    9088$commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type', 'comment_parent', 'user_ID');
     
    9593do_action('set_comment_cookies', $comment, $user);
    9694
    97 $location = empty($post_data['redirect_to']) ? get_comment_link($comment_id) : $post_data['redirect_to'] . '#comment-' . $comment_id;
     95$location = empty($_POST['redirect_to']) ? get_comment_link($comment_id) : $_POST['redirect_to'] . '#comment-' . $comment_id;
    9896$location = apply_filters('comment_post_redirect', $location, $comment);
    9997
Note: See TracChangeset for help on using the changeset viewer.