Ticket #46666: 46666.patch
File 46666.patch, 3.0 KB (added by , 6 years ago) |
---|
-
functions.php
2954 2954 * @type string $link_text A label for the link to include. Only works in combination with $link_url. 2955 2955 * Default empty string. 2956 2956 * @type bool $back_link Whether to include a link to go back. Default false. 2957 * @type string $charset Character set of the response HTML 2958 * Default is "utf-8". 2957 2959 * @type string $text_direction The text direction. This is only useful internally, when WordPress 2958 2960 * is still loading and the site's locale is not set up yet. Accepts 'rtl'. 2959 2961 * Default is the value of is_rtl(). … … 3079 3081 3080 3082 if ( ! did_action( 'admin_head' ) ) : 3081 3083 if ( ! headers_sent() ) { 3082 header( 'Content-Type: text/html; charset=utf-8' ); 3084 $charset = $r['charset']; 3085 header( "Content-Type: text/html; charset=$charset" ); 3083 3086 status_header( $r['response'] ); 3084 3087 nocache_headers(); 3085 3088 } … … 3090 3093 } else { 3091 3094 $dir_attr = "dir='$text_direction'"; 3092 3095 } 3096 3097 $charset = $r['charset']; 3098 $charset_attr = "charset=$charset"; 3099 3093 3100 ?> 3094 3101 <!DOCTYPE html> 3095 3102 <html xmlns="http://www.w3.org/1999/xhtml" <?php echo $dir_attr; ?>> 3096 3103 <head> 3097 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />3104 <meta http-equiv="Content-Type" content="text/html; <?php echo $charset_attr; ?>" /> 3098 3105 <meta name="viewport" content="width=device-width"> 3099 3106 <?php 3100 3107 if ( function_exists( 'wp_no_robots' ) ) { … … 3297 3304 ); 3298 3305 3299 3306 if ( ! headers_sent() ) { 3300 header( 'Content-Type: application/json; charset=utf-8' ); 3307 $charset = $r['charset']; 3308 header( "Content-Type: application/json; charset=$charset" ); 3301 3309 if ( null !== $r['response'] ) { 3302 3310 status_header( $r['response'] ); 3303 3311 } … … 3335 3343 ); 3336 3344 3337 3345 if ( ! headers_sent() ) { 3338 header( 'Content-Type: application/javascript; charset=utf-8' ); 3346 $charset = $r['charset']; 3347 header( "Content-Type: application/javascript; charset=$charset" ); 3339 3348 header( 'X-Content-Type-Options: nosniff' ); 3340 3349 header( 'X-Robots-Tag: noindex' ); 3341 3350 if ( null !== $r['response'] ) { … … 3415 3424 EOD; 3416 3425 3417 3426 if ( ! headers_sent() ) { 3418 header( 'Content-Type: text/xml; charset=utf-8' ); 3427 $charset = $r['charset']; 3428 header( "Content-Type: text/xml; charset=$charset" ); 3419 3429 if ( null !== $r['response'] ) { 3420 3430 status_header( $r['response'] ); 3421 3431 } … … 3473 3483 'code' => '', 3474 3484 'exit' => true, 3475 3485 'back_link' => false, 3486 'charset' => 'utf-8', 3476 3487 'link_url' => '', 3477 3488 'link_text' => '', 3478 3489 'text_direction' => '', … … 3530 3541 $args['text_direction'] = 'rtl'; 3531 3542 } 3532 3543 } 3544 if ( ! empty( $args['charset'] ) ) { 3545 $args['charset'] = _canonical_charset($args['charset']); 3546 } 3533 3547 3534 3548 return array( $message, $title, $args ); 3535 3549 }