Changeset 11610
- Timestamp:
- 06/19/2009 07:30:17 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/upgrade.php
r11384 r11610 69 69 case 1: 70 70 wp_upgrade(); 71 72 if ( empty( $_GET['backto'] ) ) 73 $backto = __get_option( 'home' ) . '/'; 74 else { 75 $backto = stripslashes( urldecode( $_GET['backto'] ) ); 71 72 $backto = empty($_GET['backto']) ? '' : $_GET['backto'] ; 73 $backto = stripslashes( urldecode( $backto ) ); 76 74 $backto = esc_url_raw( $backto ); 77 }75 $backto = wp_validate_redirect($backto, __get_option( 'home' ) . '/'); 78 76 ?> 79 77 <h2><?php _e( 'Upgrade Complete' ); ?></h2> -
trunk/wp-includes/pluggable.php
r11506 r11610 909 909 * 910 910 * @since 2.3 911 * @uses apply_filters() Calls 'allowed_redirect_hosts' on an array containing 912 * WordPress host string and $location host string. 911 * @uses wp_validate_redirect() To validate the redirect is to an allowed host. 913 912 * 914 913 * @return void Does not return anything … … 919 918 $location = wp_sanitize_redirect($location); 920 919 920 $location = wp_validate_redirect($location, admin_url()); 921 922 wp_redirect($location, $status); 923 } 924 endif; 925 926 if ( !function_exists('wp_validate_redirect') ) : 927 /** 928 * Validates a URL for use in a redirect. 929 * 930 * Checks whether the $location is using an allowed host, if it has an absolute 931 * path. A plugin can therefore set or remove allowed host(s) to or from the 932 * list. 933 * 934 * If the host is not allowed, then the redirect is to $default supplied 935 * 936 * @since 2.8.1 937 * @uses apply_filters() Calls 'allowed_redirect_hosts' on an array containing 938 * WordPress host string and $location host string. 939 * 940 * @param string $location The redirect to validate 941 * @param string $default The value to return is $location is not allowed 942 * @return string redirect-sanitized URL 943 **/ 944 function wp_validate_redirect($location, $default = '') { 921 945 // browsers will assume 'http' is your protocol, and will obey a redirect to a URL starting with '//' 922 946 if ( substr($location, 0, 2) == '//' ) … … 932 956 933 957 if ( isset($lp['host']) && ( !in_array($lp['host'], $allowed_hosts) && $lp['host'] != strtolower($wpp['host'])) ) 934 $location = admin_url();935 936 wp_redirect($location, $status);958 $location = $default; 959 960 return $location; 937 961 } 938 962 endif;
Note: See TracChangeset
for help on using the changeset viewer.