Skip to content
Permalink
Browse files Browse the repository at this point in the history
Formatting: Ensure that wp_validate_redirect() sanitizes a wider vari…
…ety of characters.

Merges [47949] to the 5.4 branch.
Props: xknow, vortfu.

git-svn-id: https://develop.svn.wordpress.org/branches/5.4@47955 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
desrosj committed Jun 10, 2020
1 parent 0977c0d commit 6ef777e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/wp-includes/pluggable.php
Expand Up @@ -1407,7 +1407,7 @@ function wp_safe_redirect( $location, $status = 302, $x_redirect_by = 'WordPress
* @return string redirect-sanitized URL
*/
function wp_validate_redirect( $location, $default = '' ) {
$location = trim( $location, " \t\n\r\0\x08\x0B" );
$location = wp_sanitize_redirect( trim( $location, " \t\n\r\0\x08\x0B" ) );
// Browsers will assume 'http' is your protocol, and will obey a redirect to a URL starting with '//'.
if ( substr( $location, 0, 2 ) == '//' ) {
$location = 'http:' . $location;
Expand Down

0 comments on commit 6ef777e

Please sign in to comment.