Ticket #6873 (closed defect: fixed)

Opened 7 months ago

Last modified 4 months ago

Character set problem in media uploader

Reported by: duncanmc Assigned to: anonymous
Priority: normal Milestone: 2.6
Component: Administration Version: 2.5.1
Severity: normal Keywords: charset, character set
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

05/30/08 20:42:28 changed by ryan

  • status changed from new to closed.
  • resolution set to fixed.

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

05/30/08 20:42:52 changed by ryan

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

07/15/08 16:24:07 changed by ryan

  • milestone changed from 2.5.2 to 2.9.

Milestone 2.5.2 deleted

07/30/08 20:33:14 changed by westi

  • milestone changed from 2.9 to 2.6.