Live+Press: Victory!

I have downloaded Live+Press plugin for WordPress that can synchronize my WordPress-based blog and my LiveJournal. Of course, with my luck, nothing worked out of the box. After several debugging attempts I found that

1. PHP will automatically encode special characters in any posted form field, whereas “foo’bar” becomes “foo\’bar”.

2. This happens even to passwords.

3. The password hash then comes out wrong and LJ won’t accept it.

4. Needless to say, my password contained a special character.

Moral: never, ever do good deeds prematurely. If someone wants to write strings to the database, let the database worry about the special characters. Not everything POSTed is intended to a database, so there is no point (and it is even harmful) to automatically escape it.

PS. Why does the trackback link look so ugly? Well, I will deal with it later. Meanwhile, sorry for its appearance.

Leave a Reply

Your email address will not be published. Required fields are marked *