Use wp_get_referer(). Props robmiller. fixes #2855

git-svn-id: https://develop.svn.wordpress.org/trunk@3921 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2006-06-24 21:14:58 +00:00
parent 98b02c5e7c
commit bbc66458c0
3 changed files with 4 additions and 4 deletions

View File

@ -164,10 +164,10 @@ if ('publish' != $post->post_status || 0 == $post_ID) {
<input name="referredby" type="hidden" id="referredby" value="<?php
if ( !empty($_REQUEST['popupurl']) )
echo wp_specialchars($_REQUEST['popupurl']);
else if ( url_to_postid($_SERVER['HTTP_REFERER']) == $post_ID )
else if ( url_to_postid(wp_get_referer()) == $post_ID )
echo 'redo';
else
echo wp_specialchars($_SERVER['HTTP_REFERER']);
echo wp_specialchars(wp_get_referer());
?>" /></p>
<?php do_action('edit_form_advanced'); ?>

View File

@ -64,7 +64,7 @@ edCanvas = document.getElementById('content');
<?php if ('bookmarklet' != $mode) {
echo '<input name="advanced" type="submit" id="advancededit" tabindex="7" value="' . __('Advanced Editing &raquo;') . '" />';
} ?>
<input name="referredby" type="hidden" id="referredby" value="<?php if (isset($_SERVER['HTTP_REFERER'])) echo urlencode($_SERVER['HTTP_REFERER']); ?>" />
<input name="referredby" type="hidden" id="referredby" value="<?php if (isset(wp_get_referer())) echo urlencode($_SERVER['HTTP_REFERER']); ?>" />
</p>
<?php do_action('simple_edit_form', ''); ?>

View File

@ -7,5 +7,5 @@ if ( get_magic_quotes_gpc() )
// 10 days
setcookie('wp-postpass_' . COOKIEHASH, $_POST['post_password'], time() + 864000, COOKIEPATH);
wp_redirect($_SERVER['HTTP_REFERER']);
wp_redirect(wp_get_referer());
?>