WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 2 weeks 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:

Description

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>';
die();

}

Change History (2)

comment:1 @nyuwec6 years ago

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

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

comment:2 @DrewAPicture2 weeks ago

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