Remove calls to html_entity_decode(). fixes #2029

git-svn-id: http://svn.automattic.com/wordpress/trunk@3276 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2005-12-07 00:36:07 +00:00
parent 0d0c51e8fe
commit 1547da4733
6 changed files with 17 additions and 11 deletions

View File

@ -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);

View File

@ -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];

View File

@ -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';
}

View File

@ -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;
}

View File

@ -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 '<p> </p>';
$output = $text;
$output = html_entity_decode($output); // undoes format_to_edit()
$output = convert_chars($output);
$output = wpautop($output);

View File

@ -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();