Opened 15 years ago
Closed 15 years ago
#18319 closed defect (bug) (fixed)
inline reply removes images
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 3.3 | Priority: | normal |
| Severity: | normal | Version: | 3.2.1 |
| Component: | Comments | Keywords: | has-patch |
| Focuses: | Cc: |
Description
repro:
reply to a comment through comments list in admin.
add an images to it.
click on submit
what happens:
Image isn't saved in the comment
Attachments (1)
Change History (8)
#4
@
15 years ago
In the admin, we might be able to change the nonce to a generic one for the screen. Other option is an individual wp_nonce_field() for every comment.
#5
@
15 years ago
That check was copied from wp-comments-post.php in [8720], however in admin-ajax.php we already have check_ajax_referer():
http://core.trac.wordpress.org/browser/tags/3.2.1/wp-admin/admin-ajax.php#L628
Isn't that enough to prevent possible XSRF described in #3973?
Note: See
TracTickets for help on using
tickets.
wp_comment_form_unfiltered_html_nonce()creates a nonce based on the post ID of the last comment in the list instead of a current comment, so the nonce check inadmin-ajax.phpis not satisfied:if ( current_user_can('unfiltered_html') ) { if ( wp_create_nonce('unfiltered-html-comment_' . $comment_post_ID) != $_POST['_wp_unfiltered_html_comment'] ) { kses_remove_filters(); // start with a clean slate kses_init_filters(); // set up the filters } }What is the proper way to fix this?