mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-09-02 05:36:36 +00:00
Fix probable bugs; Clean up style
This commit is contained in:
+4
-2
@@ -2,6 +2,8 @@
|
||||
|
||||
namespace Curl;
|
||||
|
||||
use Curl\ArrayUtil;
|
||||
|
||||
class Curl
|
||||
{
|
||||
const VERSION = '7.1.0';
|
||||
@@ -148,8 +150,8 @@ class Curl
|
||||
// Manually build a single-dimensional array from a multi-dimensional array as using curl_setopt($ch,
|
||||
// CURLOPT_POSTFIELDS, $data) doesn't correctly handle multi-dimensional arrays when files are
|
||||
// referenced.
|
||||
if (\Curl\ArrayUtil::is_array_multidim($data)) {
|
||||
$data = \Curl\ArrayUtil::array_flatten_multidim($data);
|
||||
if (ArrayUtil::is_array_multidim($data)) {
|
||||
$data = ArrayUtil::array_flatten_multidim($data);
|
||||
}
|
||||
|
||||
// Modify array values to ensure any referenced files are properly handled depending on the support of
|
||||
|
||||
+3
-10
@@ -453,12 +453,10 @@ class MultiCurl
|
||||
*
|
||||
* @access public
|
||||
* @param $string
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function setCookieString($string)
|
||||
{
|
||||
return $this->setOpt(CURLOPT_COOKIE, $string);
|
||||
$this->setOpt(CURLOPT_COOKIE, $string);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -466,12 +464,10 @@ class MultiCurl
|
||||
*
|
||||
* @access public
|
||||
* @param $cookie_file
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function setCookieFile($cookie_file)
|
||||
{
|
||||
return $this->setOpt(CURLOPT_COOKIEFILE, $cookie_file);
|
||||
$this->setOpt(CURLOPT_COOKIEFILE, $cookie_file);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -479,12 +475,10 @@ class MultiCurl
|
||||
*
|
||||
* @access public
|
||||
* @param $cookie_jar
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function setCookieJar($cookie_jar)
|
||||
{
|
||||
return $this->setOpt(CURLOPT_COOKIEJAR, $cookie_jar);
|
||||
$this->setOpt(CURLOPT_COOKIEJAR, $cookie_jar);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -798,7 +792,6 @@ class MultiCurl
|
||||
}
|
||||
|
||||
$this->activeCurls[$curl->id] = $curl;
|
||||
$this->responseCookies = array();
|
||||
$curl->call($curl->beforeSendFunction);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user