[wp-trac] [WordPress Trac] #10815: Admin page, missing charset errors in ajax requests when apache is configured with default charset
WordPress Trac
wp-trac at lists.automattic.com
Sat Sep 19 10:01:38 UTC 2009
#10815: Admin page, missing charset errors in ajax requests when apache is
configured with default charset
--------------------------+-------------------------------------------------
Reporter: nyuwec | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 2.8.5
Component: General | Version: 2.8.4
Severity: trivial | Keywords: ajax, charset, admin, response
--------------------------+-------------------------------------------------
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();
}
--
Ticket URL: <http://core.trac.wordpress.org/ticket/10815>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list