Changeset 36448 for branches/4.3/src/wp-includes/pluggable.php
- Timestamp:
- 02/02/2016 04:59:00 PM (10 years ago)
- File:
-
- 1 edited
-
branches/4.3/src/wp-includes/pluggable.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/4.3/src/wp-includes/pluggable.php
r34118 r36448 1313 1313 $test = ( $cut = strpos($location, '?') ) ? substr( $location, 0, $cut ) : $location; 1314 1314 1315 $lp = parse_url($test); 1315 // @-operator is used to prevent possible warnings in PHP < 5.3.3. 1316 $lp = @parse_url($test); 1316 1317 1317 1318 // Give up if malformed URL … … 1323 1324 return $default; 1324 1325 1325 // 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.1326 if ( isset($lp['scheme']) && !isset($lp['host']) )1326 // 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. 1327 if ( ! isset( $lp['host'] ) && ( isset( $lp['scheme'] ) || isset( $lp['user'] ) || isset( $lp['pass'] ) || isset( $lp['port'] ) ) ) { 1327 1328 return $default; 1329 } 1330 1331 // Reject malformed components parse_url() can return on odd inputs. 1332 foreach ( array( 'user', 'pass', 'host' ) as $component ) { 1333 if ( isset( $lp[ $component ] ) && strpbrk( $lp[ $component ], ':/?#@' ) ) { 1334 return $default; 1335 } 1336 } 1328 1337 1329 1338 $wpp = parse_url(home_url());
Note: See TracChangeset
for help on using the changeset viewer.