### Eclipse Workspace Patch 1.0
#P wordpress-trunk
|
|
|
981 | 981 | function request($url, $args = array()) { |
982 | 982 | $defaults = array( |
983 | 983 | 'method' => 'GET', 'timeout' => 5, |
984 | | 'redirection' => 5, 'httpversion' => '1.0', |
| 984 | 'redirection' => 5, 'followlocation' => true, |
| 985 | 'httpversion' => '1.0', |
985 | 986 | 'blocking' => true, |
986 | 987 | 'headers' => array(), 'body' => null, 'cookies' => array() |
987 | 988 | ); |
… |
… |
|
1027 | 1028 | 'method' => strtoupper($r['method']), |
1028 | 1029 | 'user_agent' => $r['user-agent'], |
1029 | 1030 | 'max_redirects' => $r['redirection'] + 1, // See #11557 |
| 1031 | 'follow_location' => (int) $r['followlocation'], |
1030 | 1032 | 'protocol_version' => (float) $r['httpversion'], |
1031 | 1033 | 'header' => $strHeaders, |
1032 | 1034 | 'ignore_errors' => true, // Return non-200 requests. |
… |
… |
|
1304 | 1306 | function request($url, $args = array()) { |
1305 | 1307 | $defaults = array( |
1306 | 1308 | 'method' => 'GET', 'timeout' => 5, |
1307 | | 'redirection' => 5, 'httpversion' => '1.0', |
1308 | | 'blocking' => true, |
| 1309 | 'redirection' => 5, 'followlocation' => !(ini_get('safe_mode') || ini_get('open_basedir')), |
| 1310 | 'httpversion' => '1.0', 'blocking' => true, |
1309 | 1311 | 'headers' => array(), 'body' => null, 'cookies' => array() |
1310 | 1312 | ); |
1311 | 1313 | |
… |
… |
|
1367 | 1369 | curl_setopt( $handle, CURLOPT_SSL_VERIFYPEER, $ssl_verify ); |
1368 | 1370 | curl_setopt( $handle, CURLOPT_USERAGENT, $r['user-agent'] ); |
1369 | 1371 | curl_setopt( $handle, CURLOPT_MAXREDIRS, $r['redirection'] ); |
| 1372 | curl_setopt( $handle, CURLOPT_FOLLOWLOCATION, $r['followlocation'] ); |
1370 | 1373 | |
1371 | 1374 | switch ( $r['method'] ) { |
1372 | 1375 | case 'HEAD': |
… |
… |
|
1448 | 1451 | curl_close( $handle ); |
1449 | 1452 | |
1450 | 1453 | // See #11305 - When running under safe mode, redirection is disabled above. Handle it manually. |
1451 | | if ( !empty($theHeaders['headers']['location']) && (ini_get('safe_mode') || ini_get('open_basedir')) ) { |
| 1454 | if ( $r['followlocation'] && !empty($theHeaders['headers']['location']) && (ini_get('safe_mode') || ini_get('open_basedir')) ) { |
1452 | 1455 | if ( $r['redirection']-- > 0 ) { |
1453 | 1456 | return $this->request($theHeaders['headers']['location'], $r); |
1454 | 1457 | } else { |