$location =
preg_replace_callback( $regex, '_wp_sanitize_utf8_in_redirect',
$location );
$location =
preg_replace( '|[^a-z0-9-~+_.?#=&;,/:%!*\[\]()@]|i', '',
$location );
$location =
wp_kses_no_null( $location );
// Remove %0D and %0A from location.
$strip = array
( '%0d', '%0a', '%0D', '%0A'
);
return _deep_replace( $strip,
$location );
} /**
* URL encodes UTF-8 characters in a URL.
*
* @ignore
* @since 4.2.0
* @access private
*
* @see wp_sanitize_redirect()
*
* @param array $matches RegEx matches against the redirect location.
* @return string URL-encoded version of the first RegEx match.
*/