diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php index d4b3ad9f7e..be3dc431d3 100644 --- a/wp-admin/edit-form-advanced.php +++ b/wp-admin/edit-form-advanced.php @@ -211,10 +211,10 @@ if ('publish' != $post->post_status || 0 == $post_ID) {
diff --git a/wp-admin/edit-form-comment.php b/wp-admin/edit-form-comment.php index c6bc69137d..2695c51c9b 100644 --- a/wp-admin/edit-form-comment.php +++ b/wp-admin/edit-form-comment.php @@ -89,7 +89,7 @@ else- +
diff --git a/wp-admin/edit-form.php b/wp-admin/edit-form.php index dd4bc75836..7fc09fda5a 100644 --- a/wp-admin/edit-form.php +++ b/wp-admin/edit-form.php @@ -64,7 +64,7 @@ edCanvas = document.getElementById('content'); '; } ?> - + diff --git a/wp-admin/edit-page-form.php b/wp-admin/edit-page-form.php index 65d0d0d935..5fa6b254a9 100644 --- a/wp-admin/edit-page-form.php +++ b/wp-admin/edit-page-form.php @@ -14,7 +14,7 @@ if (0 == $post_ID) { $form_extra = ""; } -$sendto = $_SERVER['HTTP_REFERER']; +$sendto = wp_get_referer(); if ( 0 != $post_ID && $sendto == get_permalink($post_ID) ) $sendto = 'redo'; diff --git a/wp-admin/link-manager.php b/wp-admin/link-manager.php index d26c9b6d7b..267d397bb8 100644 --- a/wp-admin/link-manager.php +++ b/wp-admin/link-manager.php @@ -129,7 +129,7 @@ switch ($action) { add_link(); - header('Location: ' . $_SERVER['HTTP_REFERER'] . '?added=true'); + header('Location: ' . wp_get_referer() . '?added=true'); break; } // end Add diff --git a/wp-admin/post.php b/wp-admin/post.php index d99258dc2e..1c021e3753 100644 --- a/wp-admin/post.php +++ b/wp-admin/post.php @@ -111,12 +111,12 @@ case 'editpost': $post_ID = edit_post(); if ($_POST['save']) { - $location = $_SERVER['HTTP_REFERER']; + $location = wp_get_referer(); } elseif ($_POST['updatemeta']) { - $location = $_SERVER['HTTP_REFERER'] . '&message=2#postcustom'; + $location = wp_get_referer() . '&message=2#postcustom'; } elseif ($_POST['deletemeta']) { - $location = $_SERVER['HTTP_REFERER'] . '&message=3#postcustom'; - } elseif (isset($_POST['referredby']) && $_POST['referredby'] != $_SERVER['HTTP_REFERER']) { + $location = wp_get_referer() . '&message=3#postcustom'; + } elseif (!empty($_POST['referredby']) && $_POST['referredby'] != wp_get_referer()) { $location = $_POST['referredby']; if ( $_POST['referredby'] == 'redo' ) $location = get_permalink( $post_ID ); @@ -125,6 +125,7 @@ case 'editpost': } else { $location = 'post.php'; } + header ('Location: ' . $location); // Send user on their way while we keep working exit(); @@ -147,7 +148,7 @@ case 'delete': die( __('Error in deleting...') ); } - $sendback = $_SERVER['HTTP_REFERER']; + $sendback = wp_get_referer(); if (strstr($sendback, 'post.php')) $sendback = get_settings('siteurl') .'/wp-admin/post.php'; elseif (strstr($sendback, 'attachments.php')) $sendback = get_settings('siteurl') .'/wp-admin/attachments.php'; $sendback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $sendback); @@ -234,8 +235,8 @@ case 'deletecomment': wp_set_comment_status($comment->comment_ID, "delete"); do_action('delete_comment', $comment->comment_ID); - if (($_SERVER['HTTP_REFERER'] != "") && (false == $noredir)) { - header('Location: ' . $_SERVER['HTTP_REFERER']); + if ((wp_get_referer() != "") && (false == $noredir)) { + header('Location: ' . wp_get_referer()); } else { header('Location: '. get_settings('siteurl') .'/wp-admin/edit.php?p='.$p.'&c=1#comments'); } @@ -261,8 +262,8 @@ case 'unapprovecomment': wp_set_comment_status($comment->comment_ID, "hold"); - if (($_SERVER['HTTP_REFERER'] != "") && (false == $noredir)) { - header('Location: ' . $_SERVER['HTTP_REFERER']); + if ((wp_get_referer() != "") && (false == $noredir)) { + header('Location: ' . wp_get_referer()); } else { header('Location: '. get_settings('siteurl') .'/wp-admin/edit.php?p='.$p.'&c=1#comments'); } @@ -312,8 +313,8 @@ case 'approvecomment': } - if (($_SERVER['HTTP_REFERER'] != "") && (false == $noredir)) { - header('Location: ' . $_SERVER['HTTP_REFERER']); + if ((wp_get_referer() != "") && (false == $noredir)) { + header('Location: ' . wp_get_referer()); } else { header('Location: '. get_settings('siteurl') .'/wp-admin/edit.php?p='.$p.'&c=1#comments'); } diff --git a/wp-admin/upgrade.php b/wp-admin/upgrade.php index 88877509fd..3c30d940a4 100644 --- a/wp-admin/upgrade.php +++ b/wp-admin/upgrade.php @@ -67,7 +67,7 @@ text-align: center; border-top: 1px solid #ccc; padding-top: 1em; font-style: it switch($step) { case 0: - $goback = wp_specialchars($_SERVER['HTTP_REFERER'], 1); + $goback = wp_specialchars(wp_get_referer()); ?>