WordPress.org

Make WordPress Core

Ticket #11034: admin-ajax.php.diff

File admin-ajax.php.diff, 829 bytes (added by iansealy, 6 years ago)
Line 
1*** old/wp-admin/admin-ajax.php 2009-06-28 00:39:09.000000000 +0200
2--- new/wp-admin/admin-ajax.php 2009-11-24 13:18:57.000000000 +0100
3***************
4*** 18,23 ****
5--- 18,37 ----
6  require_once('includes/admin.php');
7  @header('Content-Type: text/html; charset=' . get_option('blog_charset'));
8 
9+ function _wp_ajax_iconv_request( &$value, $key = null ) {
10+     $value = iconv('UTF-8', get_option('blog_charset') . '//TRANSLIT', $value);
11+ }
12+
13+ if ( function_exists('iconv') && get_option('blog_charset') != 'UTF-8' ) {
14+     foreach ($_POST as $key => &$value) {
15+         if (is_array($value)) {
16+             array_walk_recursive($value, '_wp_ajax_iconv_request');
17+         } else {
18+             _wp_ajax_iconv_request($value);
19+         }
20+     }
21+ }
22+
23  do_action('admin_init');
24 
25  if ( ! is_user_logged_in() ) {