Changeset 36450 for branches/4.1/src/wp-includes/pluggable.php
- Timestamp:
- 02/02/2016 04:59:19 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.1/src/wp-includes/pluggable.php
r30684 r36450 1253 1253 $test = ( $cut = strpos($location, '?') ) ? substr( $location, 0, $cut ) : $location; 1254 1254 1255 $lp = parse_url($test); 1255 // @-operator is used to prevent possible warnings in PHP < 5.3.3. 1256 $lp = @parse_url($test); 1256 1257 1257 1258 // Give up if malformed URL … … 1263 1264 return $default; 1264 1265 1265 // 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.1266 if ( isset($lp['scheme']) && !isset($lp['host']) )1266 // 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. 1267 if ( ! isset( $lp['host'] ) && ( isset( $lp['scheme'] ) || isset( $lp['user'] ) || isset( $lp['pass'] ) || isset( $lp['port'] ) ) ) { 1267 1268 return $default; 1269 } 1270 1271 // Reject malformed components parse_url() can return on odd inputs. 1272 foreach ( array( 'user', 'pass', 'host' ) as $component ) { 1273 if ( isset( $lp[ $component ] ) && strpbrk( $lp[ $component ], ':/?#@' ) ) { 1274 return $default; 1275 } 1276 } 1268 1277 1269 1278 $wpp = parse_url(home_url());
Note: See TracChangeset
for help on using the changeset viewer.