Skip to content

Commit

Permalink
Use relative paths for admin-ajax.php to avoid cross-domain issues wi…
Browse files Browse the repository at this point in the history
…th IDN domains in IE and Opera. props SergeyBiryukov, fixes #18952.

git-svn-id: http://svn.automattic.com/wordpress/trunk@19871 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
nacin committed Feb 8, 2012
1 parent eef151f commit bfeb575
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion wp-admin/admin-header.php
Expand Up @@ -55,7 +55,7 @@
'uid': '<?php if ( ! isset($current_user) ) $current_user = wp_get_current_user(); echo $current_user->ID; ?>',
'time':'<?php echo time() ?>'
},
ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>',
ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>',
pagenow = '<?php echo $current_screen->id; ?>',
typenow = '<?php echo $current_screen->post_type; ?>',
adminpage = '<?php echo $admin_body_class; ?>',
Expand Down
2 changes: 1 addition & 1 deletion wp-admin/includes/image-edit.php
Expand Up @@ -67,7 +67,7 @@ function wp_image_editor($post_id, $msg = false) {
<input type="hidden" id="imgedit-y-<?php echo $post_id; ?>" value="<?php echo $meta['height']; ?>" />

<div id="imgedit-crop-<?php echo $post_id; ?>" class="imgedit-crop-wrap">
<img id="image-preview-<?php echo $post_id; ?>" onload="imageEdit.imgLoaded('<?php echo $post_id; ?>')" src="<?php echo admin_url('admin-ajax.php'); ?>?action=imgedit-preview&amp;_ajax_nonce=<?php echo $nonce; ?>&amp;postid=<?php echo $post_id; ?>&amp;rand=<?php echo rand(1, 99999); ?>" />
<img id="image-preview-<?php echo $post_id; ?>" onload="imageEdit.imgLoaded('<?php echo $post_id; ?>')" src="<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>?action=imgedit-preview&amp;_ajax_nonce=<?php echo $nonce; ?>&amp;postid=<?php echo $post_id; ?>&amp;rand=<?php echo rand(1, 99999); ?>" />
</div>

<div class="imgedit-submit">
Expand Down
2 changes: 1 addition & 1 deletion wp-admin/includes/media.php
Expand Up @@ -334,7 +334,7 @@ function wp_iframe($content_func /* ... */) {
//<![CDATA[
addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
var userSettings = {'url':'<?php echo SITECOOKIEPATH; ?>','uid':'<?php if ( ! isset($current_user) ) $current_user = wp_get_current_user(); echo $current_user->ID; ?>','time':'<?php echo time(); ?>'};
var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>', pagenow = 'media-upload-popup', adminpage = 'media-upload-popup',
var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>', pagenow = 'media-upload-popup', adminpage = 'media-upload-popup',
isRtl = <?php echo (int) is_rtl(); ?>;
//]]>
</script>
Expand Down
2 changes: 1 addition & 1 deletion wp-admin/includes/template.php
Expand Up @@ -1394,7 +1394,7 @@ function tb_close(){var win=window.dialogArguments||opener||parent||top;win.tb_r
'uid': '<?php if ( ! isset($current_user) ) $current_user = wp_get_current_user(); echo $current_user->ID; ?>',
'time':'<?php echo time() ?>'
},
ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>',
ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>',
pagenow = '<?php echo $current_screen->id; ?>',
typenow = '<?php echo $current_screen->post_type; ?>',
adminpage = '<?php echo $admin_body_class; ?>',
Expand Down
2 changes: 1 addition & 1 deletion wp-admin/press-this.php
Expand Up @@ -304,7 +304,7 @@ function image_selector(el) {
//<![CDATA[
addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
var userSettings = {'url':'<?php echo SITECOOKIEPATH; ?>','uid':'<?php if ( ! isset($current_user) ) $current_user = wp_get_current_user(); echo $current_user->ID; ?>','time':'<?php echo time() ?>'};
var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>', pagenow = 'press-this', isRtl = <?php echo (int) is_rtl(); ?>;
var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>', pagenow = 'press-this', isRtl = <?php echo (int) is_rtl(); ?>;
var photostorage = false;
//]]>
</script>
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/class-wp-editor.php
Expand Up @@ -584,7 +584,7 @@ public static function editor_js() {
}

if ( !is_admin() )
echo 'var ajaxurl = "' . admin_url('admin-ajax.php') . '";';
echo 'var ajaxurl = "' . admin_url( 'admin-ajax.php', 'relative' ) . '";';
?>
</script>
<?php
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/media.php
Expand Up @@ -1096,7 +1096,7 @@ function maybe_run_ajax_cache() {
<script type="text/javascript">
/* <![CDATA[ */
jQuery(document).ready(function($){
$.get("<?php echo admin_url( 'admin-ajax.php?action=oembed-cache&post=' . $post_ID ); ?>");
$.get("<?php echo admin_url( 'admin-ajax.php?action=oembed-cache&post=' . $post_ID, 'relative' ); ?>");
});
/* ]]> */
</script>
Expand Down

0 comments on commit bfeb575

Please sign in to comment.