Changeset 36449 for branches/4.2/src/wp-includes/pluggable.php
- Timestamp:
- 02/02/2016 04:59:15 PM (10 years ago)
- File:
-
- 1 edited
-
branches/4.2/src/wp-includes/pluggable.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/4.2/src/wp-includes/pluggable.php
r32376 r36449 1297 1297 $test = ( $cut = strpos($location, '?') ) ? substr( $location, 0, $cut ) : $location; 1298 1298 1299 $lp = parse_url($test); 1299 // @-operator is used to prevent possible warnings in PHP < 5.3.3. 1300 $lp = @parse_url($test); 1300 1301 1301 1302 // Give up if malformed URL … … 1307 1308 return $default; 1308 1309 1309 // 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.1310 if ( isset($lp['scheme']) && !isset($lp['host']) )1310 // 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. 1311 if ( ! isset( $lp['host'] ) && ( isset( $lp['scheme'] ) || isset( $lp['user'] ) || isset( $lp['pass'] ) || isset( $lp['port'] ) ) ) { 1311 1312 return $default; 1313 } 1314 1315 // Reject malformed components parse_url() can return on odd inputs. 1316 foreach ( array( 'user', 'pass', 'host' ) as $component ) { 1317 if ( isset( $lp[ $component ] ) && strpbrk( $lp[ $component ], ':/?#@' ) ) { 1318 return $default; 1319 } 1320 } 1312 1321 1313 1322 $wpp = parse_url(home_url());
Note: See TracChangeset
for help on using the changeset viewer.