Changeset 23554 for trunk/wp-comments-post.php
- Timestamp:
- 03/01/2013 04:28:40 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-comments-post.php
r23416 r23554 18 18 nocache_headers(); 19 19 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; 23 21 24 22 $post = get_post($comment_post_ID); … … 50 48 } 51 49 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; 56 54 57 55 // If the user is logged in … … 59 57 if ( $user->exists() ) { 60 58 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); 65 63 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'] ) { 67 65 kses_remove_filters(); // start with a clean slate 68 66 kses_init_filters(); // set up the filters … … 86 84 wp_die( __('<strong>ERROR</strong>: please type a comment.') ); 87 85 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; 89 87 90 88 $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type', 'comment_parent', 'user_ID'); … … 95 93 do_action('set_comment_cookies', $comment, $user); 96 94 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; 98 96 $location = apply_filters('comment_post_redirect', $location, $comment); 99 97
Note: See TracChangeset
for help on using the changeset viewer.