Bad Behavior does not like Windows Live Writer
There is a bug in the newly released Windows Live Writer beta 2 that causes it to choke if you are also using Bad Behavior on your blog.
I first discovered this when I installed it yesterday to check it out. When it refused to update the theme from my blog, I wondered at first if there was a problem with my custom theme, but then half an hour later I looked at my home page again to find that all the comments on my blog had closed. A quick investigation showed that Bad Behavior had been choking on the requests from Windows Live Writer and logging the failed attempts, which were then being picked up by my new plugin, Three Strikes and You’re Out.
It turns out that the problem stems from the fact that Bad Behavior expects Internet Explorer to include an “Accept” header with every HTTP request, and if it gets something that claims to be Internet Explorer yet doesn’t match up to its expectation, it throws an error.
Fortunately, it is not too difficult to fix this, though you do need to tweak the code base of Bad Behavior. Open the file msie.php in the bad-behavior subdirectory of your Bad Behavior plugin and find the lines which say:
if (!array_key_exists('Accept', $package['headers_mixed'])) {
return "17566707";
}
Change this to read as follows:
if (strpos($package['headers_mixed']['User-Agent'], "Windows Live Writer")
=== FALSE && !array_key_exists('Accept', $package['headers_mixed'])) {
return "17566707";
}
You should then be able to use Windows Live Writer on your blog once again, without losing the protection offered by the Bad Behavior plugin.

RSS feed
Posted at 08:33 in 

13:33
Good on you! It works! Thanks heaps…
20:00
I’ve been going crazy trying to figure out what was wrong with my wordpress setup. I thought it was some weird permission error on my webhosting side. Thanks for posting this up.
03:50
Any ideas if you get this 403 error and you do NOT have the bad behavior plugin? My wife posted using Live Writer just 2 days ago and now I’m getting 403 errors.
14:20
Thanks for this - it works as advertised. However my file was named msie.inc.php, not msie.php.
14:36
Sorry, you’re right. It should be msie.inc.php not msie.php.
02:44
Thanks for the fix. You’re a saviour.
12:57
Thanks for the help James.
09:37
Followed a link from the Wordpress forums to your site. It solved my problem with WLW. Thanks for figuring it out!
08:15
I’ve been going crazy trying to figure out what was wrong with my wordpress setup. I thought it was some weird permission error on my webhosting side. Thanks for posting this up.