Changeset 36454 for branches/3.7/src/wp-includes/pluggable.php
- Timestamp:
- 02/02/2016 04:59:34 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.7/src/wp-includes/pluggable.php
r30416 r36454 977 977 $test = ( $cut = strpos($location, '?') ) ? substr( $location, 0, $cut ) : $location; 978 978 979 $lp = parse_url($test); 979 // @-operator is used to prevent possible warnings in PHP < 5.3.3. 980 $lp = @parse_url($test); 980 981 981 982 // Give up if malformed URL … … 987 988 return $default; 988 989 989 // Reject if scheme isset but host is not. This catches urls like https:host.com for which parse_url does not set the host field.990 if ( isset($lp['scheme']) && !isset($lp['host']) )990 // Reject if certain components are set but host is not. This catches urls like https:host.com for which parse_url does not set the host field. 991 if ( ! isset( $lp['host'] ) && ( isset( $lp['scheme'] ) || isset( $lp['user'] ) || isset( $lp['pass'] ) || isset( $lp['port'] ) ) ) { 991 992 return $default; 993 } 994 995 // Reject malformed components parse_url() can return on odd inputs. 996 foreach ( array( 'user', 'pass', 'host' ) as $component ) { 997 if ( isset( $lp[ $component ] ) && strpbrk( $lp[ $component ], ':/?#@' ) ) { 998 return $default; 999 } 1000 } 992 1001 993 1002 $wpp = parse_url(home_url());
Note: See TracChangeset
for help on using the changeset viewer.