Last active
December 21, 2015 22:59
-
-
Save almirage/6378921 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -u wp-includes/comment-template.php.org wp-includes/comment-template.php | |
@@ -1168,6 +1168,7 @@ | |
$replytoid = isset($_GET['replytocom']) ? (int) $_GET['replytocom'] : 0; | |
$result = "<input type='hidden' name='comment_post_ID' value='$id' id='comment_post_ID' />\n"; | |
$result .= "<input type='hidden' name='comment_parent' id='comment_parent' value='$replytoid' />\n"; | |
+ $result .= "<script type='text/javascript'>document.write('<');document.write('input type=\"hidden\" name=\"comment_token\" value=\"ok\" />');</script>\n"; | |
return apply_filters('comment_id_fields', $result, $id, $replytoid); | |
} | |
diff -u wp-comments-post.php.org wp-comments-post.php | |
@@ -25,6 +25,10 @@ | |
do_action('comment_id_not_found', $comment_post_ID); | |
exit; | |
} | |
+if (empty($_POST["comment_token"])) { | |
+ do_action('illegal post', $comment_post_ID); | |
+ exit; | |
+} | |
// get_post_status() will get the parent status for attachments. | |
$status = get_post_status($post); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment