Changeset 40691
- Timestamp:
- 05/16/2017 08:40:15 AM (8 years ago)
- Location:
- branches/4.6
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.6
-
branches/4.6/src/wp-includes/class-http.php
r38895 r40691 311 311 $options['hooks']->register( 'requests.before_redirect', array( get_class(), 'browser_redirect_compatibility' ) ); 312 312 313 // Validate redirected URLs. 314 if ( function_exists( 'wp_kses_bad_protocol' ) && $r['reject_unsafe_urls'] ) { 315 $options['hooks']->register( 'requests.before_redirect', array( get_class(), 'validate_redirects' ) ); 316 } 317 313 318 if ( $r['stream'] ) { 314 319 $options['filename'] = $r['filename']; … … 468 473 if ( $original->status_code === 302 ) { 469 474 $options['type'] = Requests::GET; 475 } 476 } 477 478 /** 479 * Validate redirected URLs. 480 * 481 * @throws Requests_Exception On unsuccessful URL validation 482 * @param string $location URL to redirect to. 483 */ 484 public static function validate_redirects( $location ) { 485 if ( ! wp_http_validate_url( $location ) ) { 486 throw new Requests_Exception( __('A valid URL was not provided.'), 'wp_http.redirect_failed_validation' ); 470 487 } 471 488 }
Note: See TracChangeset
for help on using the changeset viewer.