On this page
WP_Http::validate_redirects( string $location )
Validate redirected URLs.
Parameters
$locationstring Required-
URL to redirect to.
Source
File: wp-includes/class-wp-http.php. View all references
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' );
}
}
Related
Uses
| Uses | Description |
|---|---|
| Requests_Exception::__construct() wp-includes/Requests/Exception.php | Create a new exception |
| wp_http_validate_url() wp-includes/http.php | Validate a URL for safe use in the HTTP API. |
| __() wp-includes/l10n.php | Retrieves the translation of $text. |
Changelog
| Version | Description |
|---|---|
| 4.7.5 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_http/validate_redirects