Make WordPress Core

Opened 17 years ago

Closed 17 years ago

Last modified 16 years ago

#6873 closed defect (bug) (fixed)

Character set problem in media uploader

Reported by: duncanmc's profile duncanmc Owned by:
Milestone: 2.6 Priority: normal
Severity: normal Version: 2.5.1
Component: Administration Keywords: charset, character set
Focuses: Cc:

Description

I am using a windows-1254 based translation file and my blog character encoding is windows-1254. After uploading an image by using the media uploader, when I click on "Show", character encoding of image property text like "caption", "link url" etc. are wrong. They show ? characters on special characters. I saw that it is because AJAX does not send the encoding type information when updating the page, so encoding becomes wrong. To solve this problem it is necessary to change the line

header('Content-Type: text/plain');

to

header('Content-Type: text/plain; charset=' . get_option('blog_charset'));

in the file wp-admin/async-upload.php file. More exact place of the line is


// Flash often fails to send cookies with the POST or upload, so we need to pass it in GET or POST instead
if ( empty($_COOKIE[AUTH_COOKIE]) && !empty($_REQUEST['auth_cookie']) )
	$_COOKIE[AUTH_COOKIE] = $_REQUEST['auth_cookie'];
unset($current_user);
require_once('admin.php');

header('Content-Type: text/plain');

must be

// Flash often fails to send cookies with the POST or upload, so we need to pass it in GET or POST instead
if ( empty($_COOKIE[AUTH_COOKIE]) && !empty($_REQUEST['auth_cookie']) )
	$_COOKIE[AUTH_COOKIE] = $_REQUEST['auth_cookie'];
unset($current_user);
require_once('admin.php');

header('Content-Type: text/plain; charset=' . get_option('blog_charset'));

Change History (4)

#1 @ryan
17 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [8021]) Add charset to async-upload content-type header. Props duncanmc. fixes #6873 for trunk

#2 @ryan
17 years ago

(In [8022]) Add charset to async-upload content-type header. Props duncanmc. fixes #6873 for 2.5

#3 @ryan
17 years ago

  • Milestone changed from 2.5.2 to 2.9

Milestone 2.5.2 deleted

#4 @westi
16 years ago

  • Milestone changed from 2.9 to 2.6
Note: See TracTickets for help on using tickets.