Changeset 23416 for trunk/wp-comments-post.php
- Timestamp:
- 02/14/2013 10:51:06 PM (13 years ago)
- File:
-
- 1 edited
-
trunk/wp-comments-post.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-comments-post.php
r20425 r23416 18 18 nocache_headers(); 19 19 20 $comment_post_ID = isset($_POST['comment_post_ID']) ? (int) $_POST['comment_post_ID'] : 0; 20 $post_data = wp_unslash( $_POST ); 21 22 $comment_post_ID = isset($post_data['comment_post_ID']) ? (int) $post_data['comment_post_ID'] : 0; 21 23 22 24 $post = get_post($comment_post_ID); … … 48 50 } 49 51 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;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; 54 56 55 57 // If the user is logged in … … 57 59 if ( $user->exists() ) { 58 60 if ( empty( $user->display_name ) ) 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);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; 63 65 if ( current_user_can('unfiltered_html') ) { 64 if ( wp_create_nonce('unfiltered-html-comment_' . $comment_post_ID) != $ _POST['_wp_unfiltered_html_comment'] ) {66 if ( wp_create_nonce('unfiltered-html-comment_' . $comment_post_ID) != $post_data['_wp_unfiltered_html_comment'] ) { 65 67 kses_remove_filters(); // start with a clean slate 66 68 kses_init_filters(); // set up the filters … … 84 86 wp_die( __('<strong>ERROR</strong>: please type a comment.') ); 85 87 86 $comment_parent = isset($ _POST['comment_parent']) ? absint($_POST['comment_parent']) : 0;88 $comment_parent = isset($post_data['comment_parent']) ? absint($post_data['comment_parent']) : 0; 87 89 88 90 $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type', 'comment_parent', 'user_ID'); … … 93 95 do_action('set_comment_cookies', $comment, $user); 94 96 95 $location = empty($ _POST['redirect_to']) ? get_comment_link($comment_id) : $_POST['redirect_to'] . '#comment-' . $comment_id;97 $location = empty($post_data['redirect_to']) ? get_comment_link($comment_id) : $post_data['redirect_to'] . '#comment-' . $comment_id; 96 98 $location = apply_filters('comment_post_redirect', $location, $comment); 97 99
Note: See TracChangeset
for help on using the changeset viewer.