
{"id":480,"date":"2010-05-03T22:09:00","date_gmt":"2010-05-04T02:09:00","guid":{"rendered":"http:\/\/www.ikriv.com\/blog\/?p=480"},"modified":"2010-05-03T22:09:00","modified_gmt":"2010-05-04T02:09:00","slug":"livepress-victory","status":"publish","type":"post","link":"https:\/\/ikriv.com\/blog\/?p=480","title":{"rendered":"Live+Press: Victory!"},"content":{"rendered":"<p>I have downloaded <a href=\"http:\/\/code.google.com\/p\/livepress\/\">Live+Press <\/a> plugin for WordPress that can synchronize my <a href=\"http:\/\/www.ikriv.com\/blog\/\">WordPress-based blog<\/a> and my <a href=\"yatur.livejournal.com\/\">LiveJournal<\/a>. Of course, with my luck, nothing worked out of the box. After several debugging attempts I found that<\/p>\n<p>1. PHP will <a href=\"http:\/\/php.net\/manual\/en\/function.addslashes.php\">automatically encode<\/a> special characters in any posted form field, whereas &#8220;foo&#8217;bar&#8221; becomes &#8220;foo\\&#8217;bar&#8221;.<\/p>\n<p>2. This happens even to passwords.<\/p>\n<p>3. The password hash then comes out wrong and LJ won&#8217;t accept it.<\/p>\n<p>4. Needless to say, my password contained a special character.<\/p>\n<p>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.<\/p>\n<p>PS. Why does the trackback link look so ugly? Well, I will deal with it later. Meanwhile, sorry for its appearance.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 <a href=\"https:\/\/ikriv.com\/blog\/?p=480\" class=\"more-link\">[&hellip;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"Layout":"","footnotes":""},"categories":[2],"tags":[],"class_list":["entry","author-ikriv","post-480","post","type-post","status-publish","format-standard","category-misc"],"_links":{"self":[{"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/480","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=480"}],"version-history":[{"count":0,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/480\/revisions"}],"wp:attachment":[{"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=480"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=480"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=480"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}