diff options
author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-06-26 15:40:12 +0000 |
---|---|---|
committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-06-26 15:40:12 +0000 |
commit | a4383a13a1522aa6b9db861b732249d0a3897140 (patch) | |
tree | f8e3465a0aa68577fb452ca1a1e020cb1ae49571 /wp-includes/functions.php | |
parent | e9274e601b49af6a87b2c79d356910114bbdcfbc (diff) | |
download | wordpress-mu-a4383a13a1522aa6b9db861b732249d0a3897140.tar.gz wordpress-mu-a4383a13a1522aa6b9db861b732249d0a3897140.tar.xz wordpress-mu-a4383a13a1522aa6b9db861b732249d0a3897140.zip |
WP Merge
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@595 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes/functions.php')
-rw-r--r-- | wp-includes/functions.php | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 1882962..63416a9 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -833,6 +833,33 @@ function wp_nonce_url($actionurl, $action = -1) { function wp_nonce_field($action = -1) { echo '<input type="hidden" name="_wpnonce" value="' . wp_create_nonce($action) . '" />'; + wp_referer_field(); +} + +function wp_referer_field() { + $ref = wp_specialchars($_SERVER['REQUEST_URI']); + echo '<input type="hidden" name="_wp_http_referer" value="'. $ref . '" />'; + if ( wp_get_original_referer() ) { + $original_ref = wp_specialchars(stripslashes(wp_get_original_referer())); + echo '<input type="hidden" name="_wp_original_http_referer" value="'. $original_ref . '" />'; + } +} + +function wp_original_referer_field() { + echo '<input type="hidden" name="_wp_original_http_referer" value="' . wp_specialchars(stripslashes($_SERVER['REQUEST_URI'])) . '" />'; +} + +function wp_get_referer() { + foreach ( array($_REQUEST['_wp_http_referer'], $_SERVER['HTTP_REFERER']) as $ref ) + if ( !empty($ref) ) + return $ref; + return false; +} + +function wp_get_original_referer() { + if ( !empty($_REQUEST['_wp_original_http_referer']) ) + return $_REQUEST['_wp_original_http_referer']; + return false; } function wp_mkdir_p($target) { |