summaryrefslogtreecommitdiff
path: root/server/vendor/guzzlehttp/guzzle/src/Cookie
diff options
context:
space:
mode:
authormanzerbredes <loic.guegan_secondary@yahoo.fr>2016-03-28 12:17:43 +0200
committermanzerbredes <loic.guegan_secondary@yahoo.fr>2016-03-28 12:17:43 +0200
commit53f65de9d4163c9c095f2b8e87baca648c3645bd (patch)
tree37f167f38b25aa50bd7dd1429438c0245a280a28 /server/vendor/guzzlehttp/guzzle/src/Cookie
parent60cfe3ebc039df8d6a468a43a59e7fd8c2a16956 (diff)
parent804fa322d841d73ee7592885ec500dc94e91b9e6 (diff)
Test
Diffstat (limited to 'server/vendor/guzzlehttp/guzzle/src/Cookie')
-rwxr-xr-xserver/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php18
-rwxr-xr-xserver/vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php9
2 files changed, 9 insertions, 18 deletions
diff --git a/server/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php b/server/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php
index 11421fe..0b932ae 100755
--- a/server/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php
+++ b/server/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php
@@ -5,7 +5,7 @@ use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
/**
- * Cookie jar that stores cookies an an array
+ * Cookie jar that stores cookies as an array
*/
class CookieJar implements CookieJarInterface
{
@@ -58,22 +58,10 @@ class CookieJar implements CookieJarInterface
}
/**
- * Quote the cookie value if it is not already quoted and it contains
- * problematic characters.
- *
- * @param string $value Value that may or may not need to be quoted
- *
- * @return string
+ * @deprecated
*/
public static function getCookieValue($value)
{
- if (substr($value, 0, 1) !== '"' &&
- substr($value, -1, 1) !== '"' &&
- strpbrk($value, ';,=')
- ) {
- $value = '"' . $value . '"';
- }
-
return $value;
}
@@ -248,7 +236,7 @@ class CookieJar implements CookieJarInterface
(!$cookie->getSecure() || $scheme == 'https')
) {
$values[] = $cookie->getName() . '='
- . self::getCookieValue($cookie->getValue());
+ . $cookie->getValue();
}
}
diff --git a/server/vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php b/server/vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php
index e4e6248..9887c1d 100755
--- a/server/vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php
+++ b/server/vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php
@@ -11,7 +11,7 @@ class FileCookieJar extends CookieJar
/** @var bool Control whether to persist session cookies or not. */
private $storeSessionCookies;
-
+
/**
* Create a new FileCookieJar object
*
@@ -55,7 +55,8 @@ class FileCookieJar extends CookieJar
}
}
- if (false === file_put_contents($filename, json_encode($json))) {
+ $jsonStr = \GuzzleHttp\json_encode($json);
+ if (false === file_put_contents($filename, $jsonStr)) {
throw new \RuntimeException("Unable to save file {$filename}");
}
}
@@ -73,9 +74,11 @@ class FileCookieJar extends CookieJar
$json = file_get_contents($filename);
if (false === $json) {
throw new \RuntimeException("Unable to load file {$filename}");
+ } elseif ($json === '') {
+ return;
}
- $data = json_decode($json, true);
+ $data = \GuzzleHttp\json_decode($json, true);
if (is_array($data)) {
foreach (json_decode($json, true) as $cookie) {
$this->setCookie(new SetCookie($cookie));