Description: Strip control characters before validating redirect
Author: aaroncampbell@wordpress.org
Origin: upstream, https://core.trac.wordpress.org/changeset/40190/branches/4.1?format=diff&new=40190
Applied-Upstream: 4.7.3
Reviewed-by: Craig Small <csmall@debian.org>
Last-Update: 2017-03-08
--- a/wp-includes/pluggable.php
+++ b/wp-includes/pluggable.php
@@ -1240,7 +1240,7 @@
  * @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;
