Created
April 27, 2015 18:16
-
-
Save hereswhatidid/ad365893f64f0d4f9b92 to your computer and use it in GitHub Desktop.
WordPress 4.2 comment fix - this will disable any comment over a certain lenght that could theoretically trigger the XSS vulnerability.
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
<?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