mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-08-27 18:50:43 +00:00
Fix #257: Preserve space in cookie delimiter
This commit is contained in:
+4
-4
@@ -543,10 +543,10 @@ class Curl
|
||||
*/
|
||||
public function setCookie($key, $value)
|
||||
{
|
||||
$this->cookies[$key] = $value;
|
||||
$this->setOpt(CURLOPT_COOKIE, implode('; ', array_map(function($name) {
|
||||
return $name . '=' . str_replace(' ', '%20', $this->cookies[$name]);
|
||||
}, array_keys($this->cookies))));
|
||||
$this->cookies[$key] = $value;
|
||||
$this->setOpt(CURLOPT_COOKIE, implode('; ', array_map(function($this, $name) {
|
||||
return $name . '=' . str_replace(' ', '%20', $this->cookies[$name]);
|
||||
}, array($this), array_keys($this->cookies))));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -661,7 +661,7 @@ class CurlTest extends PHPUnit_Framework_TestCase
|
||||
$options = $reflectionProperty->getValue($curl);
|
||||
$this->assertEquals('cookie=Om%20nom%20nom%20nom', $options[CURLOPT_COOKIE]);
|
||||
}
|
||||
|
||||
|
||||
public function testMultipleCookies()
|
||||
{
|
||||
$curl = new Curl();
|
||||
|
||||
Reference in New Issue
Block a user