mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-03 20:24:26 +00:00
Ensure wp_get_referer() returns false when the referrer URL is the current URL.
Adds unit tests. Fixes #19856. git-svn-id: https://develop.svn.wordpress.org/trunk@36242 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1525,8 +1525,10 @@ function wp_get_referer() {
|
||||
elseif ( ! empty( $_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 false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user