Changeset 40689
- Timestamp:
- 05/16/2017 08:37:34 AM (9 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/class-http.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-http.php
r39212 r40689 307 307 $options['hooks']->register( 'requests.before_redirect', array( get_class(), 'browser_redirect_compatibility' ) ); 308 308 309 // Validate redirected URLs. 310 if ( function_exists( 'wp_kses_bad_protocol' ) && $r['reject_unsafe_urls'] ) { 311 $options['hooks']->register( 'requests.before_redirect', array( get_class(), 'validate_redirects' ) ); 312 } 313 309 314 if ( $r['stream'] ) { 310 315 $options['filename'] = $r['filename']; … … 464 469 if ( $original->status_code === 302 ) { 465 470 $options['type'] = Requests::GET; 471 } 472 } 473 474 /** 475 * Validate redirected URLs. 476 * 477 * @since 4.7.5 478 * 479 * @throws Requests_Exception On unsuccessful URL validation 480 * @param string $location URL to redirect to. 481 */ 482 public static function validate_redirects( $location ) { 483 if ( ! wp_http_validate_url( $location ) ) { 484 throw new Requests_Exception( __('A valid URL was not provided.'), 'wp_http.redirect_failed_validation' ); 466 485 } 467 486 }
Note: See TracChangeset
for help on using the changeset viewer.