### Eclipse Workspace Patch 1.0
#P wordpress-trunk
|
|
|
1304 | 1304 | function request($url, $args = array()) { |
1305 | 1305 | $defaults = array( |
1306 | 1306 | 'method' => 'GET', 'timeout' => 5, |
1307 | | 'redirection' => 5, 'httpversion' => '1.0', |
1308 | | 'blocking' => true, |
| 1307 | 'redirection' => 5, 'followlocation' => true, |
| 1308 | 'httpversion' => '1.0', 'blocking' => true, |
1309 | 1309 | 'headers' => array(), 'body' => null, 'cookies' => array() |
1310 | 1310 | ); |
1311 | 1311 | |
… |
… |
|
1367 | 1367 | curl_setopt( $handle, CURLOPT_SSL_VERIFYPEER, $ssl_verify ); |
1368 | 1368 | curl_setopt( $handle, CURLOPT_USERAGENT, $r['user-agent'] ); |
1369 | 1369 | curl_setopt( $handle, CURLOPT_MAXREDIRS, $r['redirection'] ); |
| 1370 | curl_setopt( $handle, CURLOPT_FOLLOWLOCATION, $r['followlocation'] ); |
1370 | 1371 | |
1371 | 1372 | switch ( $r['method'] ) { |
1372 | 1373 | case 'HEAD': |
… |
… |
|
1448 | 1449 | curl_close( $handle ); |
1449 | 1450 | |
1450 | 1451 | // 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')) ) { |
| 1452 | if ( $r['followlocation'] && !empty($theHeaders['headers']['location']) && (ini_get('safe_mode') || ini_get('open_basedir')) ) { |
1452 | 1453 | if ( $r['redirection']-- > 0 ) { |
1453 | 1454 | return $this->request($theHeaders['headers']['location'], $r); |
1454 | 1455 | } else { |