刚刚升级到 WordPress 3.4.1,我很郁闷地发现,每次我输入一个 LaTeX 公式,反斜杠就消失了。我得把 \ 换成 \\,但每次一保存,两个就变成了一个,再保存一次就没了。研究了一下终于发现了罪魁祸首,把它去掉就好了:
/wp-includes/load.php
function wp_magic_quotes() {
// If already slashed, strip.
if ( get_magic_quotes_gpc() ) {
$_GET = stripslashes_deep( $_GET );
// $_POST = stripslashes_deep( $_POST );
$_COOKIE = stripslashes_deep( $_COOKIE );
}
// Escape with wpdb.
$_GET = add_magic_quotes( $_GET );
$_POST = add_magic_quotes( $_POST );
$_COOKIE = add_magic_quotes( $_COOKIE );
$_SERVER = add_magic_quotes( $_SERVER );
// Force REQUEST to be GET + POST.
$_REQUEST = array_merge( $_GET, $_POST );
}
