Pass blog charset to html_entity_decode(). Props adferguson. fixes #7563
git-svn-id: http://svn.automattic.com/wordpress/trunk@10688 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
8fb1093aad
commit
a33afa3546
|
@ -437,7 +437,7 @@ class Blogger_Import {
|
|||
if ( count( $matches[1] ) )
|
||||
foreach ( $matches[1] as $match )
|
||||
if ( preg_match('/rel=.previous./', $match) )
|
||||
$query = html_entity_decode( preg_replace('/^.*href=[\'"].*\?(.+)[\'"].*$/', '$1', $match) );
|
||||
$query = html_entity_decode( preg_replace('/^.*href=[\'"].*\?(.+)[\'"].*$/', '$1', $match), ENT_COMPAT, get_option('blog_charset') );
|
||||
|
||||
if ( $query ) {
|
||||
parse_str($query, $q);
|
||||
|
@ -495,7 +495,7 @@ class Blogger_Import {
|
|||
if ( count( $matches[1] ) )
|
||||
foreach ( $matches[1] as $match )
|
||||
if ( preg_match('/rel=.previous./', $match) )
|
||||
$query = html_entity_decode( preg_replace('/^.*href=[\'"].*\?(.+)[\'"].*$/', '$1', $match) );
|
||||
$query = html_entity_decode( preg_replace('/^.*href=[\'"].*\?(.+)[\'"].*$/', '$1', $match), ENT_COMPAT, get_option('blog_charset') );
|
||||
|
||||
parse_str($query, $q);
|
||||
|
||||
|
@ -545,7 +545,7 @@ class Blogger_Import {
|
|||
}
|
||||
|
||||
$post_date = $this->convert_date( $entry->published );
|
||||
$post_content = trim( addslashes( $this->no_apos( html_entity_decode( $entry->content ) ) ) );
|
||||
$post_content = trim( addslashes( $this->no_apos( html_entity_decode( $entry->content, ENT_COMPAT, get_option('blog_charset') ) ) ) );
|
||||
$post_title = trim( addslashes( $this->no_apos( $this->min_whitespace( $entry->title ) ) ) );
|
||||
$post_status = isset( $entry->draft ) ? 'draft' : 'publish';
|
||||
|
||||
|
@ -600,7 +600,7 @@ class Blogger_Import {
|
|||
$comment_author = addslashes( $this->no_apos( strip_tags( (string) $matches[1] ) ) );
|
||||
$comment_author_url = addslashes( $this->no_apos( strip_tags( (string) $matches[2] ) ) );
|
||||
$comment_date = $this->convert_date( $entry->updated );
|
||||
$comment_content = addslashes( $this->no_apos( html_entity_decode( $entry->content ) ) );
|
||||
$comment_content = addslashes( $this->no_apos( html_entity_decode( $entry->content, ENT_COMPAT, get_option('blog_charset') ) ) );
|
||||
|
||||
// Clean up content
|
||||
$comment_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $comment_content);
|
||||
|
|
|
@ -747,7 +747,7 @@ function wp_dashboard_plugins_output() {
|
|||
$title = $item->get_title();
|
||||
$title = wp_specialchars( $title );
|
||||
|
||||
$description = wp_specialchars( strip_tags(html_entity_decode($item->get_description(), ENT_QUOTES)) );
|
||||
$description = wp_specialchars( strip_tags(html_entity_decode($item->get_description(), ENT_QUOTES, get_option('blog_charset'))) );
|
||||
|
||||
list($link, $frag) = explode( '#', $item->get_link() );
|
||||
|
||||
|
|
|
@ -340,7 +340,7 @@ function get_the_category_rss($type = 'rss') {
|
|||
elseif ( 'atom' == $type )
|
||||
$the_list .= sprintf( '<category scheme="%1$s" term="%2$s" />', attribute_escape( apply_filters( 'get_bloginfo_rss', get_bloginfo( 'url' ) ) ), attribute_escape( $cat_name ) );
|
||||
else
|
||||
$the_list .= "\n\t\t<category><![CDATA[" . html_entity_decode( $cat_name ) . "]]></category>\n";
|
||||
$the_list .= "\n\t\t<category><![CDATA[" . html_entity_decode( $cat_name, ENT_COMPAT, get_option('blog_charset') ) . "]]></category>\n";
|
||||
}
|
||||
|
||||
return apply_filters('the_category_rss', $the_list, $type);
|
||||
|
|
|
@ -1505,7 +1505,7 @@ function wp_widget_rss($args, $widget_args = 1) {
|
|||
$link = clean_url(strip_tags($rss->get_permalink()));
|
||||
while ( strstr($link, 'http') != $link )
|
||||
$link = substr($link, 1);
|
||||
$desc = attribute_escape(strip_tags(html_entity_decode($rss->get_description(), ENT_QUOTES)));
|
||||
$desc = attribute_escape(strip_tags(html_entity_decode($rss->get_description(), ENT_QUOTES, get_option('blog_charset'))));
|
||||
$title = $options[$number]['title'];
|
||||
if ( empty($title) )
|
||||
$title = htmlentities(strip_tags($rss->get_title()));
|
||||
|
@ -1575,7 +1575,7 @@ function wp_widget_rss_output( $rss, $args = array() ) {
|
|||
if ( empty($title) )
|
||||
$title = __('Untitled');
|
||||
|
||||
$desc = str_replace(array("\n", "\r"), ' ', attribute_escape(strip_tags(html_entity_decode($item->get_description(), ENT_QUOTES))));
|
||||
$desc = str_replace(array("\n", "\r"), ' ', attribute_escape(strip_tags(html_entity_decode($item->get_description(), ENT_QUOTES, get_option('blog_charset')))));
|
||||
$desc = wp_html_excerpt( $desc, 360 ) . ' […]';
|
||||
$desc = wp_specialchars( $desc );
|
||||
|
||||
|
|
Loading…
Reference in New Issue