Don't call curl_setopt() if safe_mode is enabled. Props ionfish and Po0ky. fixes #7458 see #4779

git-svn-id: http://svn.automattic.com/wordpress/trunk@8534 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-08-04 17:03:05 +00:00
parent 2d6e153cb4
commit 2eb0dffaaa
1 changed files with 3 additions and 1 deletions

View File

@ -862,9 +862,11 @@ class WP_Http_Curl {
curl_setopt( $handle, CURLOPT_USERAGENT, $r['user-agent'] ); curl_setopt( $handle, CURLOPT_USERAGENT, $r['user-agent'] );
curl_setopt( $handle, CURLOPT_CONNECTTIMEOUT, 1 ); curl_setopt( $handle, CURLOPT_CONNECTTIMEOUT, 1 );
curl_setopt( $handle, CURLOPT_TIMEOUT, $r['timeout'] ); curl_setopt( $handle, CURLOPT_TIMEOUT, $r['timeout'] );
curl_setopt( $handle, CURLOPT_FOLLOWLOCATION, true );
curl_setopt( $handle, CURLOPT_MAXREDIRS, $r['redirection'] ); curl_setopt( $handle, CURLOPT_MAXREDIRS, $r['redirection'] );
if ( !ini_get('safe_mode') && !ini_get('open_basedir') )
curl_setopt( $handle, CURLOPT_FOLLOWLOCATION, true );
if( ! is_null($headers) ) if( ! is_null($headers) )
curl_setopt( $handle, CURLOPT_HTTPHEADER, $headers ); curl_setopt( $handle, CURLOPT_HTTPHEADER, $headers );