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

see #25294.

Built from https://develop.svn.wordpress.org/trunk@25400


git-svn-id: http://core.svn.wordpress.org/trunk@25331 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2013-09-12 13:36:09 +00:00
parent 46611d4282
commit 4542e678d2
1 changed files with 1 additions and 1 deletions

View File

@ -1326,7 +1326,7 @@ function wp_get_referer() {
* @return string|bool False if no original referer or original referer if set. * @return string|bool False if no original referer or original referer if set.
*/ */
function wp_get_original_referer() { 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 wp_validate_redirect( wp_unslash( $_REQUEST['_wp_original_http_referer'] ), false );
return false; return false;
} }