Skip to content
This repository was archived by the owner on Sep 22, 2022. It is now read-only.

Commit 4e7f1d7

Browse files
committed
Fix PHP 5.3 "Fatal error: Using $this when not in object context"
1 parent f0bc858 commit 4e7f1d7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Curl/Curl.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -544,9 +544,9 @@ public function setDigestAuthentication($username, $password = '')
544544
public function setCookie($key, $value)
545545
{
546546
$this->cookies[$key] = $value;
547-
$this->setOpt(CURLOPT_COOKIE, implode('; ', array_map(function($this, $name) {
548-
return $name . '=' . str_replace(' ', '%20', $this->cookies[$name]);
549-
}, array($this), array_keys($this->cookies))));
547+
$this->setOpt(CURLOPT_COOKIE, implode('; ', array_map(function($k, $v) {
548+
return $k . '=' . str_replace(' ', '%20', $v);
549+
}, array_keys($this->cookies), array_values($this->cookies))));
550550
}
551551

552552
/**

0 commit comments

Comments
 (0)