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
This commit is contained in:
Andrew Nacin 2013-09-12 13:35:35 +00:00
parent cc5477c7d9
commit 1851da1382

View File

@ -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;
}