Ensure `wp_get_referer()` returns `false` when the referrer URL is the current URL.
Adds unit tests. Fixes #19856. Built from https://develop.svn.wordpress.org/trunk@36242 git-svn-id: http://core.svn.wordpress.org/trunk@36209 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
fdb6bbfa10
commit
d591f26ce7
|
@ -1525,8 +1525,10 @@ function wp_get_referer() {
|
||||||
elseif ( ! empty( $_SERVER['HTTP_REFERER'] ) )
|
elseif ( ! empty( $_SERVER['HTTP_REFERER'] ) )
|
||||||
$ref = wp_unslash( $_SERVER['HTTP_REFERER'] );
|
$ref = wp_unslash( $_SERVER['HTTP_REFERER'] );
|
||||||
|
|
||||||
if ( $ref && $ref !== wp_unslash( $_SERVER['REQUEST_URI'] ) )
|
if ( $ref && $ref !== wp_unslash( $_SERVER['REQUEST_URI'] ) && $ref !== home_url() . wp_unslash( $_SERVER['REQUEST_URI'] ) ) {
|
||||||
return wp_validate_redirect( $ref, false );
|
return wp_validate_redirect( $ref, false );
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.5-alpha-36241';
|
$wp_version = '4.5-alpha-36242';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue