Delay Trackback data escaping until after mb_convert_encoding(). Props to Stefan Esser.
git-svn-id: http://svn.automattic.com/wordpress/trunk@4676 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
6befacf8f7
commit
b7371396c3
|
@ -31,11 +31,13 @@ if ( !$_GET['tb_id'] ) {
|
|||
}
|
||||
|
||||
$tb_url = $_POST['url'];
|
||||
$title = $_POST['title'];
|
||||
$excerpt = $_POST['excerpt'];
|
||||
$blog_name = $_POST['blog_name'];
|
||||
$charset = $_POST['charset'];
|
||||
|
||||
// These three are stripslashed here so that they can be properly escaped after mb_convert_encoding()
|
||||
$title = stripslashes($_POST['title']);
|
||||
$excerpt = stripslashes($_POST['excerpt']);
|
||||
$blog_name = stripslashes($_POST['blog_name']);
|
||||
|
||||
if ($charset)
|
||||
$charset = strtoupper( trim($charset) );
|
||||
else
|
||||
|
@ -47,6 +49,11 @@ if ( function_exists('mb_convert_encoding') ) { // For international trackbacks
|
|||
$blog_name = mb_convert_encoding($blog_name, get_option('blog_charset'), $charset);
|
||||
}
|
||||
|
||||
// Now that mb_convert_encoding() has been given a swing, we need to escape these three
|
||||
$title = $wpdb->escape($title);
|
||||
$excerpt = $wpdb->escape($excerpt);
|
||||
$blog_name = $wpdb->escape($blog_name);
|
||||
|
||||
if ( is_single() || is_page() )
|
||||
$tb_id = $posts[0]->ID;
|
||||
|
||||
|
|
Loading…
Reference in New Issue