Skip to content

Commit 5615aef

Browse files
Avoid an undefined index notice when submitting a comment with JavaScript disabled. fixes #24752.
git-svn-id: https://develop.svn.wordpress.org/trunk@25121 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 512c12b commit 5615aef

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/wp-comments-post.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@
6060
$comment_author = wp_slash( $user->display_name );
6161
$comment_author_email = wp_slash( $user->user_email );
6262
$comment_author_url = wp_slash( $user->user_url );
63-
if ( current_user_can('unfiltered_html') ) {
64-
if ( wp_create_nonce('unfiltered-html-comment_' . $comment_post_ID) != $_POST['_wp_unfiltered_html_comment'] ) {
63+
if ( current_user_can( 'unfiltered_html' ) && isset( $_POST['_wp_unfiltered_html_comment'] ) ) {
64+
if ( wp_create_nonce( 'unfiltered-html-comment_' . $comment_post_ID ) != $_POST['_wp_unfiltered_html_comment'] ) {
6565
kses_remove_filters(); // start with a clean slate
6666
kses_init_filters(); // set up the filters
6767
}

0 commit comments

Comments
 (0)