Changeset 36447 for branches/4.4/src/wp-includes/pluggable.php
- Timestamp:
- 02/02/2016 04:58:49 PM (10 years ago)
- File:
-
- 1 edited
-
branches/4.4/src/wp-includes/pluggable.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/4.4/src/wp-includes/pluggable.php
r35735 r36447 1334 1334 $test = ( $cut = strpos($location, '?') ) ? substr( $location, 0, $cut ) : $location; 1335 1335 1336 $lp = parse_url($test); 1336 // @-operator is used to prevent possible warnings in PHP < 5.3.3. 1337 $lp = @parse_url($test); 1337 1338 1338 1339 // Give up if malformed URL … … 1344 1345 return $default; 1345 1346 1346 // 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.1347 if ( isset($lp['scheme']) && !isset($lp['host']) )1347 // 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. 1348 if ( ! isset( $lp['host'] ) && ( isset( $lp['scheme'] ) || isset( $lp['user'] ) || isset( $lp['pass'] ) || isset( $lp['port'] ) ) ) { 1348 1349 return $default; 1350 } 1351 1352 // Reject malformed components parse_url() can return on odd inputs 1353 foreach ( array( 'user', 'pass', 'host' ) as $component ) { 1354 if ( isset( $lp[ $component ] ) && strpbrk( $lp[ $component ], ':/?#@' ) ) { 1355 return $default; 1356 } 1357 } 1349 1358 1350 1359 $wpp = parse_url(home_url());
Note: See TracChangeset
for help on using the changeset viewer.