* @return string redirect-sanitized URL
**/
function wp_validate_redirect($location, $default = '') {
+ $location = trim( $location );
// 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;