Make WordPress Core

Opened 12 years ago

Closed 12 years ago

Last modified 7 years ago

#10815 closed defect (bug) (invalid)

Admin page, missing charset errors in ajax requests when apache is configured with default charset

Reported by: nyuwec Owned by:
Milestone: Priority: normal
Severity: trivial Version: 2.8.4
Component: General Keywords: ajax, charset, admin, response
Focuses: Cc:


When (for example) a new category is added in the edit post page, the ajax response header contains only the text/xml content-type attribute, but "charset" is missing, so if Apache is configured with AddDefaultCharset iso-8859-2, but blog_charset is set to UTF-8 there will be a garbled response.

the quick fix for this bug is to replace the WP_Ajax_Response->send() method in the wp-includes/classes.php file to this:

function send() {

header('Content-Type: text/xml; charset='.get_option('blog_charset'));
echo "<?xml version='1.0' standalone='yes'?><wp_ajax>";
foreach ( (array) $this->responses as $response )

echo $response;

echo '</wp_ajax>';


Change History (2)

#1 @nyuwec
12 years ago

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

Check #10817 for a better solution and description about this bug.

#2 @DrewAPicture
7 years ago

  • Milestone 2.8.5 deleted
Note: See TracTickets for help on using tickets.