Ticket #18952: idn-ajax-workaround.php
| File idn-ajax-workaround.php, 499 bytes (added by , 14 years ago) |
|---|
| Line | |
|---|---|
| 1 | <?php |
| 2 | /* |
| 3 | Plugin Name: IDN AJAX Workaround |
| 4 | Version: 0.1 |
| 5 | Plugin URI: http://core.trac.wordpress.org/ticket/18952 |
| 6 | Description: Fixes AJAX requests on sites with IDN domains in IE and Opera. |
| 7 | Author: Sergey Biryukov |
| 8 | Author URI: http://profiles.wordpress.org/sergeybiryukov/ |
| 9 | */ |
| 10 | |
| 11 | function iaw_replace_domain($url) { |
| 12 | if ( false !== strpos( $url, 'admin-ajax.php' ) ) |
| 13 | $url = preg_replace( '#^http(s)?://[^/]*#', '', $url ); |
| 14 | return $url; |
| 15 | } |
| 16 | add_filter('admin_url', 'iaw_replace_domain'); |
| 17 | ?> |