From 244804028c88e1770d4068f857b9b3d2744766eb Mon Sep 17 00:00:00 2001 From: Aaron Campbell Date: Mon, 6 Mar 2017 13:45:58 +0000 Subject: [PATCH] Strip control characters before validating redirect. Merges [40183] to 3.9 branch. Built from https://develop.svn.wordpress.org/branches/3.9@40192 git-svn-id: http://core.svn.wordpress.org/branches/3.9@40131 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/pluggable.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php index 285b160260..c8957dcc42 100644 --- a/wp-includes/pluggable.php +++ b/wp-includes/pluggable.php @@ -1185,7 +1185,7 @@ if ( !function_exists('wp_validate_redirect') ) : * @return string redirect-sanitized URL **/ function wp_validate_redirect($location, $default = '') { - $location = trim( $location ); + $location = 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;