Return false from wp_get_referer() if it is called before wp_validate_redirect() is defined.

see #25294.


git-svn-id: https://develop.svn.wordpress.org/trunk@25399 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2013-09-12 13:32:41 +00:00
parent 3ae18e68ff
commit cc5477c7d9
1 changed files with 2 additions and 0 deletions

View File

@ -1303,6 +1303,8 @@ function wp_original_referer_field( $echo = true, $jump_back_to = 'current' ) {
* @return string|bool False on failure. Referer URL on success.
*/
function wp_get_referer() {
if ( ! function_exists( 'wp_validate_redirect' ) )
return false;
$ref = false;
if ( ! empty( $_REQUEST['_wp_http_referer'] ) )
$ref = wp_unslash( $_REQUEST['_wp_http_referer'] );