Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
WordPress 4.2 comment fix - this will disable any comment over a certain lenght that could theoretically trigger the XSS vulnerability.
<?php
add_filter( 'pre_comment_content', function( $content ) {
if ( strlen( $content ) > 64000 )
wp_die( 'Invalid comment.' );
return $content;
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.