From 1851da1382be79efd35594ad274603d38872ecbd Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Thu, 12 Sep 2013 13:35:35 +0000 Subject: [PATCH] Return false from wp_get_original_referer() if it is called before wp_validate_redirect() is defined. see #25294. git-svn-id: https://develop.svn.wordpress.org/trunk@25400 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php index 8ca7da28af..8cd4af4f68 100644 --- a/src/wp-includes/functions.php +++ b/src/wp-includes/functions.php @@ -1326,7 +1326,7 @@ function wp_get_referer() { * @return string|bool False if no original referer or original referer if set. */ function wp_get_original_referer() { - if ( !empty( $_REQUEST['_wp_original_http_referer'] ) ) + if ( ! empty( $_REQUEST['_wp_original_http_referer'] ) && function_exists( 'wp_validate_redirect' ) ) return wp_validate_redirect( wp_unslash( $_REQUEST['_wp_original_http_referer'] ), false ); return false; }