From ea6c1efcb90a8a8d5af4cf4b6c7232b9359ab7a3 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Fri, 24 Apr 2009 16:57:27 +0000 Subject: [PATCH] Silence html_entity_decode warnings. Props Denis-de-Bernardy. fixes #9616 git-svn-id: https://develop.svn.wordpress.org/trunk@11081 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/import/blogger.php | 8 ++++---- wp-admin/import/livejournal.php | 2 +- wp-admin/includes/dashboard.php | 2 +- wp-includes/default-widgets.php | 4 ++-- wp-includes/feed.php | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/wp-admin/import/blogger.php b/wp-admin/import/blogger.php index 32371dda6b..e80634a7d2 100644 --- a/wp-admin/import/blogger.php +++ b/wp-admin/import/blogger.php @@ -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), ENT_COMPAT, get_option('blog_charset') ); + $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), ENT_COMPAT, get_option('blog_charset') ); + $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, ENT_COMPAT, get_option('blog_charset') ) ) ) ); + $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, ENT_COMPAT, get_option('blog_charset') ) ) ); + $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); diff --git a/wp-admin/import/livejournal.php b/wp-admin/import/livejournal.php index 83602255df..4c6427731a 100644 --- a/wp-admin/import/livejournal.php +++ b/wp-admin/import/livejournal.php @@ -576,7 +576,7 @@ class LJ_API_Import { // Get the body and HTMLize it preg_match( '|(.*)|is', $comment, $matches ); $comment_content = !empty( $comment_subject ) ? $comment_subject . "\n\n" . $matches[1] : $matches[1]; - $comment_content = html_entity_decode( $comment_content ); + $comment_content = @html_entity_decode( $comment_content, ENT_COMPAT, get_option('blog_charset') ); $comment_content = str_replace( ''', "'", $comment_content ); $comment_content = wpautop( $comment_content ); $comment_content = str_replace( '
', '
', $comment_content ); diff --git a/wp-admin/includes/dashboard.php b/wp-admin/includes/dashboard.php index cd210a7179..6f7c15cf99 100644 --- a/wp-admin/includes/dashboard.php +++ b/wp-admin/includes/dashboard.php @@ -800,7 +800,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, get_option('blog_charset'))) ); + $description = wp_specialchars( strip_tags(@html_entity_decode($item->get_description(), ENT_QUOTES, get_option('blog_charset'))) ); $ilink = wp_nonce_url('plugin-install.php?tab=plugin-information&plugin=' . $slug, 'install-plugin_' . $slug) . '&TB_iframe=true&width=600&height=800'; diff --git a/wp-includes/default-widgets.php b/wp-includes/default-widgets.php index d8f67e3fe3..b8b3e9790a 100644 --- a/wp-includes/default-widgets.php +++ b/wp-includes/default-widgets.php @@ -711,7 +711,7 @@ function wp_widget_rss($args, $widget_args = 1) { $desc = ''; $link = ''; if ( ! is_wp_error($rss) ) { - $desc = attribute_escape(strip_tags(html_entity_decode($rss->get_description(), ENT_QUOTES, get_option('blog_charset')))); + $desc = attribute_escape(strip_tags(@html_entity_decode($rss->get_description(), ENT_QUOTES, get_option('blog_charset')))); if ( empty($title) ) $title = htmlentities(strip_tags($rss->get_title())); $link = clean_url(strip_tags($rss->get_permalink())); @@ -788,7 +788,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, get_option('blog_charset'))))); + $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 ); diff --git a/wp-includes/feed.php b/wp-includes/feed.php index 68240512c6..799dcdb7bb 100644 --- a/wp-includes/feed.php +++ b/wp-includes/feed.php @@ -340,7 +340,7 @@ function get_the_category_rss($type = 'rss') { elseif ( 'atom' == $type ) $the_list .= sprintf( '', attribute_escape( apply_filters( 'get_bloginfo_rss', get_bloginfo( 'url' ) ) ), attribute_escape( $cat_name ) ); else - $the_list .= "\t\t\n"; + $the_list .= "\t\t\n"; } return apply_filters('the_category_rss', $the_list, $type);