Skip to content

Commit bbc6645

Browse files
committed
Use wp_get_referer(). Props robmiller. fixes WordPress#2855
git-svn-id: https://develop.svn.wordpress.org/trunk@3921 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 98b02c5 commit bbc6645

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

wp-admin/edit-form-advanced.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,10 @@ function focusit() {
164164
<input name="referredby" type="hidden" id="referredby" value="<?php
165165
if ( !empty($_REQUEST['popupurl']) )
166166
echo wp_specialchars($_REQUEST['popupurl']);
167-
else if ( url_to_postid($_SERVER['HTTP_REFERER']) == $post_ID )
167+
else if ( url_to_postid(wp_get_referer()) == $post_ID )
168168
echo 'redo';
169169
else
170-
echo wp_specialchars($_SERVER['HTTP_REFERER']);
170+
echo wp_specialchars(wp_get_referer());
171171
?>" /></p>
172172

173173
<?php do_action('edit_form_advanced'); ?>

wp-admin/edit-form.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ function focusit() { // focus on first input field
6464
<?php if ('bookmarklet' != $mode) {
6565
echo '<input name="advanced" type="submit" id="advancededit" tabindex="7" value="' . __('Advanced Editing &raquo;') . '" />';
6666
} ?>
67-
<input name="referredby" type="hidden" id="referredby" value="<?php if (isset($_SERVER['HTTP_REFERER'])) echo urlencode($_SERVER['HTTP_REFERER']); ?>" />
67+
<input name="referredby" type="hidden" id="referredby" value="<?php if (isset(wp_get_referer())) echo urlencode($_SERVER['HTTP_REFERER']); ?>" />
6868
</p>
6969

7070
<?php do_action('simple_edit_form', ''); ?>

wp-pass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
// 10 days
88
setcookie('wp-postpass_' . COOKIEHASH, $_POST['post_password'], time() + 864000, COOKIEPATH);
99

10-
wp_redirect($_SERVER['HTTP_REFERER']);
10+
wp_redirect(wp_get_referer());
1111
?>

0 commit comments

Comments
 (0)