X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/f9001779751f83dc8a10e478bfecb4d8dd5f964c..6c8f14c09105d0afa4c1574215c59b5021040e76:/wp-includes/class-wp-ajax-response.php diff --git a/wp-includes/class-wp-ajax-response.php b/wp-includes/class-wp-ajax-response.php index cf64bfbc..24eb687f 100644 --- a/wp-includes/class-wp-ajax-response.php +++ b/wp-includes/class-wp-ajax-response.php @@ -16,7 +16,7 @@ class WP_Ajax_Response { var $responses = array(); /** - * PHP4 Constructor - Passes args to {@link WP_Ajax_Response::add()}. + * Constructor - Passes args to {@link WP_Ajax_Response::add()}. * * @since 2.1.0 * @see WP_Ajax_Response::add() @@ -24,7 +24,7 @@ class WP_Ajax_Response { * @param string|array $args Optional. Will be passed to add() method. * @return WP_Ajax_Response */ - function WP_Ajax_Response( $args = '' ) { + function __construct( $args = '' ) { if ( !empty($args) ) $this->add($args); } @@ -126,13 +126,14 @@ class WP_Ajax_Response { * @since 2.1.0 */ function send() { - header('Content-Type: text/xml'); - echo ""; + header( 'Content-Type: text/xml; charset=' . get_option( 'blog_charset' ) ); + echo ""; foreach ( (array) $this->responses as $response ) echo $response; echo ''; - die(); + if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) + wp_die(); + else + die(); } } - -?>