{"id":901,"date":"2012-06-30T20:01:35","date_gmt":"2012-07-01T00:01:35","guid":{"rendered":"http:\/\/www.jlao.net\/?p=901"},"modified":"2012-10-19T11:48:38","modified_gmt":"2012-10-19T15:48:38","slug":"backslashes-in-wplatex","status":"publish","type":"post","link":"https:\/\/www.jlao.net\/en\/technology\/901\/","title":{"rendered":"Backslashes in WP LaTeX"},"content":{"rendered":"<p>Just newly upgraded to WordPress 3.4.1, and I&#8217;m dismayed to find that whenever I try to type a LaTeX formula, the backslash disappears. I have to replace \\ with \\\\, but every time I do a save, the two becomes one, and next time it becomes none. After some investigation, I finally got the culprit:<\/p>\n<p>\/wp-includes\/load.php<\/p>\n<pre class=\"wrap:true lang:php decode:true start-line:531 mark:5 \">function wp_magic_quotes() {\r\n\t\/\/ If already slashed, strip.\r\n\tif ( get_magic_quotes_gpc() ) {\r\n\t\t$_GET    = stripslashes_deep( $_GET    );\r\n\/\/      $_POST   = stripslashes_deep( $_POST   );\r\n\t\t$_COOKIE = stripslashes_deep( $_COOKIE );\r\n\t}\r\n\r\n\t\/\/ Escape with wpdb.\r\n\t$_GET    = add_magic_quotes( $_GET    );\r\n\t$_POST   = add_magic_quotes( $_POST   );\r\n\t$_COOKIE = add_magic_quotes( $_COOKIE );\r\n\t$_SERVER = add_magic_quotes( $_SERVER );\r\n\r\n\t\/\/ Force REQUEST to be GET + POST.\r\n\t$_REQUEST = array_merge( $_GET, $_POST );\r\n}<\/pre>\n<p>Comment out this line and everything&#8217;s fine.<\/p>","protected":false},"excerpt":{"rendered":"<p>Just newly upgraded to WordPress 3.4.1, and I&#8217;m dismayed to find that whenever I try to type a LaTeX formula, the backslash disappears. I have to replace \\ with \\\\, but every time I do a save, the two becomes one, and next time it becomes none. After some investigation, I finally got the culprit: &hellip; <a href=\"https:\/\/www.jlao.net\/en\/technology\/901\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Backslashes in WP LaTeX<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[5],"tags":[75,76,77],"class_list":["post-901","post","type-post","status-publish","format-standard","hentry","category-technology","tag-wp-latex","tag-stripslashes","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/www.jlao.net\/en\/wp-json\/wp\/v2\/posts\/901","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jlao.net\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jlao.net\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jlao.net\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jlao.net\/en\/wp-json\/wp\/v2\/comments?post=901"}],"version-history":[{"count":0,"href":"https:\/\/www.jlao.net\/en\/wp-json\/wp\/v2\/posts\/901\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.jlao.net\/en\/wp-json\/wp\/v2\/media?parent=901"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jlao.net\/en\/wp-json\/wp\/v2\/categories?post=901"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jlao.net\/en\/wp-json\/wp\/v2\/tags?post=901"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}