Silly me

And I was thinking why I’ve been getting all that comment spam lately. But of course, I updated my version of wordpress a while ago and that must have overwritten wp-comments-post.php file. So that’s why.

You can read what changes I made to it here. To have a decent error page instead of a single line of text you can replace “die” with “wp_die”. I also added the following to keep away those huge-amounts-of-links-posting-robots:

if (substr_count($comment_content, ‘<a href=’)>2){wp_die(__(‘Error: you are not allowed to post more than two links.’));}

It goes right after the line that gives you “Error: please type a comment.” Oh, and if you are a php geek and spot a security issue with using that code, I’d be glad if you let me know since I’m a beginner when it comes to php.

Edit: Since when isn’t wordpress showing you html code? Since when isn’t it surrounding paragraphs with p tags automatically? And why? :S