WP_Http::validate_redirects()public staticWP 4.7.5

Validate redirected URLs.

{} It's a method of the class: WP_Http{}

No Hooks.

Return

null. Nothing.

Usage

$result = WP_Http::validate_redirects( $location );
$location(string) (required)
URL to redirect to.

Changelog

Since 4.7.5 Introduced.

Code of WP_Http::validate_redirects() WP 6.0

public static function validate_redirects( $location ) {
	if ( ! wp_http_validate_url( $location ) ) {
		throw new Requests_Exception( __( 'A valid URL was not provided.' ), 'wp_http.redirect_failed_validation' );
	}
}