Changeset 62096
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/user.php
r61644 r62096 701 701 702 702 /** 703 * Validates the redirect URL protocol scheme. The protocol can be anything except `http` and `javascript`. 703 * Validates the redirect URL protocol scheme. 704 * 705 * The `http` scheme is allowed for loopback IP addresses (127.0.0.1, [::1]) 706 * and local environments. The `javascript` and `data` protocols are always rejected. 704 707 * 705 708 * @since 6.3.2 … … 746 749 } 747 750 748 if ( 'http' === $scheme && ! $is_local ) { 751 // Allow insecure HTTP connections to locally hosted applications. 752 $is_loopback = in_array( 753 strtolower( $host ), 754 array( '127.0.0.1', '[::1]' ), 755 true 756 ); 757 758 if ( 'http' === $scheme && ! $is_local && ! $is_loopback ) { 749 759 return new WP_Error( 750 760 'invalid_redirect_scheme', -
trunk/tests/phpunit/tests/admin/Admin_Includes_User_WpIsAuthorizeApplicationPasswordRequestValid_Test.php
r61407 r62096 82 82 'env' => $environment_type, 83 83 ); 84 85 $datasets[ $environment_type . ' and a "http" loopback "success_url"' ] = array( 86 'request' => array( 'success_url' => 'http://127.0.0.1:8080/callback' ), 87 'expected_error_code' => '', 88 'env' => $environment_type, 89 ); 90 91 $datasets[ $environment_type . ' and a "http" loopback "reject_url"' ] = array( 92 'request' => array( 'reject_url' => 'http://127.0.0.1/callback' ), 93 'expected_error_code' => '', 94 'env' => $environment_type, 95 ); 84 96 } 85 97
Note: See TracChangeset
for help on using the changeset viewer.