Jon Canady

 

Wordpress XMLRPC Angle-bracket Fix

Update: Thanks to hoystory, who pointed out that I flubbed the "apply patch" command. This is what happens when you attempt to post things past your bedtime, folks. The corrected command is below.

I kept running into problems with the previous post: I was posting through TextMate (over XMLRPC) and every time I tried to post a <pre> tag (for use with the wp-syntax plugin) the angle-brackets were being stripped out. This only occurs when posting through the XMLRPC interface, which means posting with third-party editors is hosed.

Turns out that Wordpress and libxml2 aren't playing well together: the blame seems to be on libxml2, but regardless the dude over at HooFoo wrote up a quick fix. Two things:

  1. It's not an actual patch, just a chunk of code you paste in before some function calls. I could make a patch, but I'm lazy. Here's the patch -- I left out the patch to wp-admin/import/blogger.php because I don't need to import from blogger. This patch is against Wordpress 2.7, just go into your base WP directory and type patch -p0 < wordpress-xmlrpc.diff to apply.
  2. Beware when you're copying the text from his blog: smart-quotes will cause syntax errors if you paste them in as-is. Or you could just use the patch I provide and benefit from my pain.