summaryrefslogtreecommitdiff
path: root/vendor/symfony/http-foundation/Session
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@webtrees.net>2018-10-10 09:16:43 +0100
committerGreg Roach <fisharebest@webtrees.net>2018-10-10 09:28:26 +0100
commit60362583a738c1540f918e048f7719906ff0ffd8 (patch)
tree52ca2d2fa947217a745e79e10a82315a669ac8eb /vendor/symfony/http-foundation/Session
parent15d8c1a555b43adf8338a30f36846f1640f50c00 (diff)
downloadwebtrees-60362583a738c1540f918e048f7719906ff0ffd8.tar.gz
webtrees-60362583a738c1540f918e048f7719906ff0ffd8.tar.bz2
webtrees-60362583a738c1540f918e048f7719906ff0ffd8.zip
Update vendor dependencies
Diffstat (limited to 'vendor/symfony/http-foundation/Session')
-rw-r--r--vendor/symfony/http-foundation/Session/Session.php4
-rw-r--r--vendor/symfony/http-foundation/Session/Storage/Handler/MemcacheSessionHandler.php4
-rw-r--r--vendor/symfony/http-foundation/Session/Storage/Handler/MemcachedSessionHandler.php4
-rw-r--r--vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php2
-rw-r--r--vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php25
5 files changed, 15 insertions, 24 deletions
diff --git a/vendor/symfony/http-foundation/Session/Session.php b/vendor/symfony/http-foundation/Session/Session.php
index 8a33a9c3a7..3349906875 100644
--- a/vendor/symfony/http-foundation/Session/Session.php
+++ b/vendor/symfony/http-foundation/Session/Session.php
@@ -209,7 +209,9 @@ class Session implements SessionInterface, \IteratorAggregate, \Countable
*/
public function setId($id)
{
- $this->storage->setId($id);
+ if ($this->storage->getId() !== $id) {
+ $this->storage->setId($id);
+ }
}
/**
diff --git a/vendor/symfony/http-foundation/Session/Storage/Handler/MemcacheSessionHandler.php b/vendor/symfony/http-foundation/Session/Storage/Handler/MemcacheSessionHandler.php
index 90726beb04..1b12c92189 100644
--- a/vendor/symfony/http-foundation/Session/Storage/Handler/MemcacheSessionHandler.php
+++ b/vendor/symfony/http-foundation/Session/Storage/Handler/MemcacheSessionHandler.php
@@ -47,9 +47,7 @@ class MemcacheSessionHandler implements \SessionHandlerInterface
public function __construct(\Memcache $memcache, array $options = array())
{
if ($diff = array_diff(array_keys($options), array('prefix', 'expiretime'))) {
- throw new \InvalidArgumentException(sprintf(
- 'The following options are not supported "%s"', implode(', ', $diff)
- ));
+ throw new \InvalidArgumentException(sprintf('The following options are not supported "%s"', implode(', ', $diff)));
}
$this->memcache = $memcache;
diff --git a/vendor/symfony/http-foundation/Session/Storage/Handler/MemcachedSessionHandler.php b/vendor/symfony/http-foundation/Session/Storage/Handler/MemcachedSessionHandler.php
index dd37eae14e..61a7afd904 100644
--- a/vendor/symfony/http-foundation/Session/Storage/Handler/MemcachedSessionHandler.php
+++ b/vendor/symfony/http-foundation/Session/Storage/Handler/MemcachedSessionHandler.php
@@ -50,9 +50,7 @@ class MemcachedSessionHandler extends AbstractSessionHandler
$this->memcached = $memcached;
if ($diff = array_diff(array_keys($options), array('prefix', 'expiretime'))) {
- throw new \InvalidArgumentException(sprintf(
- 'The following options are not supported "%s"', implode(', ', $diff)
- ));
+ throw new \InvalidArgumentException(sprintf('The following options are not supported "%s"', implode(', ', $diff)));
}
$this->ttl = isset($options['expiretime']) ? (int) $options['expiretime'] : 86400;
diff --git a/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php b/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php
index dd7979d4f7..c5f0527f9c 100644
--- a/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php
+++ b/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php
@@ -71,7 +71,7 @@ class PdoSessionHandler extends AbstractSessionHandler
private $pdo;
/**
- * @var string|null|false DSN string or null for session.save_path or false when lazy connection disabled
+ * @var string|false|null DSN string or null for session.save_path or false when lazy connection disabled
*/
private $dsn = false;
diff --git a/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php b/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php
index a9a54b49dd..1ec5c7ff4e 100644
--- a/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php
+++ b/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php
@@ -230,29 +230,22 @@ class NativeSessionStorage implements SessionStorageInterface
unset($_SESSION[$key]);
}
- // Register custom error handler to catch a possible failure warning during session write
- set_error_handler(function ($errno, $errstr, $errfile, $errline) {
- throw new \ErrorException($errstr, $errno, E_WARNING, $errfile, $errline);
- }, E_WARNING);
+ // Register error handler to add information about the current save handler
+ $previousHandler = set_error_handler(function ($type, $msg, $file, $line) use (&$previousHandler) {
+ if (E_WARNING === $type && 0 === strpos($msg, 'session_write_close():')) {
+ $handler = $this->saveHandler instanceof SessionHandlerProxy ? $this->saveHandler->getHandler() : $this->saveHandler;
+ $msg = sprintf('session_write_close(): Failed to write session data with "%s" handler', \get_class($handler));
+ }
+
+ return $previousHandler ? $previousHandler($type, $msg, $file, $line) : false;
+ });
try {
- $e = null;
session_write_close();
- } catch (\ErrorException $e) {
} finally {
restore_error_handler();
$_SESSION = $session;
}
- if (null !== $e) {
- // The default PHP error message is not very helpful, as it does not give any information on the current save handler.
- // Therefore, we catch this error and trigger a warning with a better error message
- $handler = $this->getSaveHandler();
- if ($handler instanceof SessionHandlerProxy) {
- $handler = $handler->getHandler();
- }
-
- trigger_error(sprintf('session_write_close(): Failed to write session data with %s handler', \get_class($handler)), E_USER_WARNING);
- }
$this->closed = true;
$this->started = false;