#6873 closed defect (bug) (fixed)
Character set problem in media uploader
Reported by: | 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'));
Note: See
TracTickets for help on using
tickets.
(In [8021]) Add charset to async-upload content-type header. Props duncanmc. fixes #6873 for trunk