Small Security Hole in WordPress!

When you add a comment to your article WordPress system adds a class which named “comment-author-’username’ “. But when you add a comment as administrator the system make this class “comment-author-yourloginname” . Bavotasan thinks it will be a security hole for WordPress. If you add this function into your theme’s functions.php this problem will be solve.

Here is the function;

function remove_comment_author_class( $classes ) {
	foreach( $classes as $key => $class ) {
		if(strstr($class, "comment-author-")) {
			unset( $classes[$key] );
		}
	}
	return $classes;
}
add_filter( 'comment_class' , 'remove_comment_author_class' );

Here is the original post!


Related posts:

If you enjoyed this post, make sure you subscribe to my RSS Feed
Comments are closed.
Highslide for Wordpress Plugin