Validate redirected URLs.
$locationstringrequired
public static function validate_redirects( $location ) {
if ( ! wp_http_validate_url( $location ) ) {
throw new WpOrg\Requests\Exception( __( 'A valid URL was not provided.' ), 'wp_http.redirect_failed_validation' );
}
}
| Version | Description |
|---|---|
| 4.7.5 | Introduced. |
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_http/validate_redirects