From 1547da4733419793f1970f8a5cd6fe9d3f9be583 Mon Sep 17 00:00:00 2001 From: ryan Date: Wed, 7 Dec 2005 00:36:07 +0000 Subject: [PATCH] Remove calls to html_entity_decode(). fixes #2029 git-svn-id: http://svn.automattic.com/wordpress/trunk@3276 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/admin-functions.php | 10 ++++++++-- wp-admin/import/blogger.php | 2 +- wp-content/themes/default/functions.php | 4 ++-- wp-content/themes/default/images/header-img.php | 4 ++-- wp-includes/functions-formatting.php | 6 +++--- wp-includes/js/tinymce/tiny_mce.js | 2 +- 6 files changed, 17 insertions(+), 11 deletions(-) diff --git a/wp-admin/admin-functions.php b/wp-admin/admin-functions.php index a3a95526d4..b587c4bbff 100644 --- a/wp-admin/admin-functions.php +++ b/wp-admin/admin-functions.php @@ -241,9 +241,12 @@ function edit_comment() { // Get an existing post and format it for editing. function get_post_to_edit($id) { + global $richedit; + $richedit = ( 'true' == get_user_option('rich_editing') ) ? true : false; + $post = get_post($id); - $post->post_content = format_to_edit($post->post_content); + $post->post_content = format_to_edit($post->post_content, $richedit); $post->post_content = apply_filters('content_edit_pre', $post->post_content); $post->post_excerpt = format_to_edit($post->post_excerpt); @@ -299,9 +302,12 @@ function get_default_post_to_edit() { } function get_comment_to_edit($id) { + global $richedit; + $richedit = ( 'true' == get_user_option('rich_editing') ) ? true : false; + $comment = get_comment($id); - $comment->comment_content = format_to_edit($comment->comment_content); + $comment->comment_content = format_to_edit($comment->comment_content, $richedit); $comment->comment_content = apply_filters('comment_edit_pre', $comment->comment_content); $comment->comment_author = format_to_edit($comment->comment_author); diff --git a/wp-admin/import/blogger.php b/wp-admin/import/blogger.php index e14aa788df..08aa0a2552 100644 --- a/wp-admin/import/blogger.php +++ b/wp-admin/import/blogger.php @@ -476,7 +476,7 @@ class Blogger_Import { else if (($comment_date[2] == 'AM') && ($commenthour == '12')) $commenthour = '00'; $comment_date = "$commentyear-$commentmonth-$commentday $commenthour:$commentminute:$commentsecond"; - $comment_author = addslashes(strip_tags(html_entity_decode($commentinfo[1]))); + $comment_author = addslashes(strip_tags($commentinfo[1])); if ( strpos($commentinfo[1], 'a href') ) { $comment_author_parts = explode('"', htmlentities($commentinfo[1])); $comment_author_url = $comment_author_parts[1]; diff --git a/wp-content/themes/default/functions.php b/wp-content/themes/default/functions.php index 90a28466ed..2af0b16d37 100644 --- a/wp-content/themes/default/functions.php +++ b/wp-content/themes/default/functions.php @@ -26,14 +26,14 @@ function kubrick_header_image() { function kubrick_upper_color() { if ( strstr( kubrick_header_image_url(), 'header-img.php?' ) ) - return substr( kubrick_header_image(), 24, 6 ); + return substr( kubrick_header_image(), 21, 6 ); else return '69aee7'; } function kubrick_lower_color() { if ( strstr( kubrick_header_image_url(), 'header-img.php?' ) ) - return substr( kubrick_header_image(), 37, 6 ); + return substr( kubrick_header_image(), 34, 6 ); else return '4180b6'; } diff --git a/wp-content/themes/default/images/header-img.php b/wp-content/themes/default/images/header-img.php index a347e2723f..afae590b0b 100644 --- a/wp-content/themes/default/images/header-img.php +++ b/wp-content/themes/default/images/header-img.php @@ -12,7 +12,7 @@ $vars = array('upper'=>array(0=>'r1', 2=>'g1', 4=>'b1'), 'lower'=>array(0=>'r2', foreach ( $vars as $var => $subvars ) { if ( isset($_GET[$var]) ) { foreach ( $subvars as $index => $subvar ) { - $$subvar = hexdec( substr( html_entity_decode($_GET[$var]), $index, 2) ); + $$subvar = hexdec( substr($_GET[$var], $index, 2) ); if ( $$subvar < 0 || $$subvar > 255 ) $default = true; } @@ -71,4 +71,4 @@ for ( $i = 0; $i < $h; $i++ ) { header("Content-Type: image/jpeg"); imagejpeg($im, '', 92); imagedestroy($im); -?> \ No newline at end of file +?> diff --git a/wp-includes/functions-formatting.php b/wp-includes/functions-formatting.php index 09cbffc175..c135b295a3 100644 --- a/wp-includes/functions-formatting.php +++ b/wp-includes/functions-formatting.php @@ -492,9 +492,10 @@ function balanceTags($text, $is_comment = 0) { } -function format_to_edit($content) { +function format_to_edit($content, $richedit = false) { $content = apply_filters('format_to_edit', $content); - $content = htmlspecialchars($content); + if (! $richedit ) + $content = htmlspecialchars($content); return $content; } @@ -997,7 +998,6 @@ function wp_richedit_pre($text) { if ( empty($text) ) return '

'; $output = $text; - $output = html_entity_decode($output); // undoes format_to_edit() $output = convert_chars($output); $output = wpautop($output); diff --git a/wp-includes/js/tinymce/tiny_mce.js b/wp-includes/js/tinymce/tiny_mce.js index 0340c47b0a..babc33533f 100644 --- a/wp-includes/js/tinymce/tiny_mce.js +++ b/wp-includes/js/tinymce/tiny_mce.js @@ -5307,7 +5307,7 @@ TinyMCEControl.prototype.execCommand = function(command, user_interface, value) // Call custom cleanup code value = tinyMCE.storeAwayURLs(value); - value = tinyMCE._customCleanup(this, "insert_to_editor", value); + //value = tinyMCE._customCleanup(this, "insert_to_editor", value); tinyMCE._setHTML(doc, value); tinyMCE.setInnerHTML(doc.body, tinyMCE._cleanupHTML(this, doc, tinyMCE.settings, doc.body)); this.convertAllRelativeURLs();