summaryrefslogtreecommitdiff
path: root/vendor/symfony/http-kernel
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@webtrees.net>2018-07-27 12:21:34 +0100
committerGreg Roach <fisharebest@webtrees.net>2018-07-27 12:21:34 +0100
commitb646d0aa207ec67f8385350355eef400d32cbaec (patch)
treebd0ee950c7a3be4740d4519ecb681cdeed93ea33 /vendor/symfony/http-kernel
parent709cf9d33cdbddcb178ad3b33a1afe38e2f0e953 (diff)
downloadwebtrees-b646d0aa207ec67f8385350355eef400d32cbaec.tar.gz
webtrees-b646d0aa207ec67f8385350355eef400d32cbaec.tar.bz2
webtrees-b646d0aa207ec67f8385350355eef400d32cbaec.zip
Update vendor dependencies
Diffstat (limited to 'vendor/symfony/http-kernel')
-rw-r--r--vendor/symfony/http-kernel/Controller/ControllerResolver.php4
-rw-r--r--vendor/symfony/http-kernel/Controller/TraceableControllerResolver.php2
-rw-r--r--vendor/symfony/http-kernel/Event/GetResponseEvent.php2
-rw-r--r--vendor/symfony/http-kernel/EventListener/AbstractTestSessionListener.php7
-rw-r--r--vendor/symfony/http-kernel/Fragment/HIncludeFragmentRenderer.php2
-rw-r--r--vendor/symfony/http-kernel/Kernel.php10
-rw-r--r--vendor/symfony/http-kernel/Tests/EventListener/TestSessionListenerTest.php34
-rw-r--r--vendor/symfony/http-kernel/Tests/Fragment/HIncludeFragmentRendererTest.php13
-rw-r--r--vendor/symfony/http-kernel/Tests/KernelTest.php2
9 files changed, 63 insertions, 13 deletions
diff --git a/vendor/symfony/http-kernel/Controller/ControllerResolver.php b/vendor/symfony/http-kernel/Controller/ControllerResolver.php
index b9d9f9fa25..0811fdf772 100644
--- a/vendor/symfony/http-kernel/Controller/ControllerResolver.php
+++ b/vendor/symfony/http-kernel/Controller/ControllerResolver.php
@@ -101,7 +101,7 @@ class ControllerResolver implements ArgumentResolverInterface, ControllerResolve
*/
public function getArguments(Request $request, $controller)
{
- @trigger_error(sprintf('%s is deprecated as of 3.1 and will be removed in 4.0. Implement the %s and inject it in the HttpKernel instead.', __METHOD__, ArgumentResolverInterface::class), E_USER_DEPRECATED);
+ @trigger_error(sprintf('The "%s()" method is deprecated as of 3.1 and will be removed in 4.0. Implement the %s and inject it in the HttpKernel instead.', __METHOD__, ArgumentResolverInterface::class), E_USER_DEPRECATED);
if (is_array($controller)) {
$r = new \ReflectionMethod($controller[0], $controller[1]);
@@ -126,7 +126,7 @@ class ControllerResolver implements ArgumentResolverInterface, ControllerResolve
*/
protected function doGetArguments(Request $request, $controller, array $parameters)
{
- @trigger_error(sprintf('%s is deprecated as of 3.1 and will be removed in 4.0. Implement the %s and inject it in the HttpKernel instead.', __METHOD__, ArgumentResolverInterface::class), E_USER_DEPRECATED);
+ @trigger_error(sprintf('The "%s()" method is deprecated as of 3.1 and will be removed in 4.0. Implement the %s and inject it in the HttpKernel instead.', __METHOD__, ArgumentResolverInterface::class), E_USER_DEPRECATED);
$attributes = $request->attributes->all();
$arguments = array();
diff --git a/vendor/symfony/http-kernel/Controller/TraceableControllerResolver.php b/vendor/symfony/http-kernel/Controller/TraceableControllerResolver.php
index 7501077140..bfb770a0d0 100644
--- a/vendor/symfony/http-kernel/Controller/TraceableControllerResolver.php
+++ b/vendor/symfony/http-kernel/Controller/TraceableControllerResolver.php
@@ -60,7 +60,7 @@ class TraceableControllerResolver implements ControllerResolverInterface, Argume
*/
public function getArguments(Request $request, $controller)
{
- @trigger_error(sprintf('The %s method is deprecated as of 3.1 and will be removed in 4.0. Please use the %s instead.', __METHOD__, TraceableArgumentResolver::class), E_USER_DEPRECATED);
+ @trigger_error(sprintf('The "%s()" method is deprecated as of 3.1 and will be removed in 4.0. Please use the %s instead.', __METHOD__, TraceableArgumentResolver::class), E_USER_DEPRECATED);
$ret = $this->argumentResolver->getArguments($request, $controller);
diff --git a/vendor/symfony/http-kernel/Event/GetResponseEvent.php b/vendor/symfony/http-kernel/Event/GetResponseEvent.php
index f7745ea3dc..c25a0f1cf1 100644
--- a/vendor/symfony/http-kernel/Event/GetResponseEvent.php
+++ b/vendor/symfony/http-kernel/Event/GetResponseEvent.php
@@ -29,7 +29,7 @@ class GetResponseEvent extends KernelEvent
/**
* Returns the response object.
*
- * @return Response
+ * @return Response|null
*/
public function getResponse()
{
diff --git a/vendor/symfony/http-kernel/EventListener/AbstractTestSessionListener.php b/vendor/symfony/http-kernel/EventListener/AbstractTestSessionListener.php
index 82061fd6ea..75f810e988 100644
--- a/vendor/symfony/http-kernel/EventListener/AbstractTestSessionListener.php
+++ b/vendor/symfony/http-kernel/EventListener/AbstractTestSessionListener.php
@@ -71,6 +71,13 @@ abstract class AbstractTestSessionListener implements EventSubscriberInterface
if ($session instanceof Session ? !$session->isEmpty() || (null !== $this->sessionId && $session->getId() !== $this->sessionId) : $wasStarted) {
$params = session_get_cookie_params();
+
+ foreach ($event->getResponse()->headers->getCookies() as $cookie) {
+ if ($session->getName() === $cookie->getName() && $params['path'] === $cookie->getPath() && $params['domain'] == $cookie->getDomain()) {
+ return;
+ }
+ }
+
$event->getResponse()->headers->setCookie(new Cookie($session->getName(), $session->getId(), 0 === $params['lifetime'] ? 0 : time() + $params['lifetime'], $params['path'], $params['domain'], $params['secure'], $params['httponly']));
$this->sessionId = $session->getId();
}
diff --git a/vendor/symfony/http-kernel/Fragment/HIncludeFragmentRenderer.php b/vendor/symfony/http-kernel/Fragment/HIncludeFragmentRenderer.php
index 7e957d4c95..ab7a83fa57 100644
--- a/vendor/symfony/http-kernel/Fragment/HIncludeFragmentRenderer.php
+++ b/vendor/symfony/http-kernel/Fragment/HIncludeFragmentRenderer.php
@@ -131,7 +131,7 @@ class HIncludeFragmentRenderer extends RoutableFragmentRenderer
if ($this->templating instanceof EngineInterface) {
try {
return $this->templating->exists($template);
- } catch (\InvalidArgumentException $e) {
+ } catch (\Exception $e) {
return false;
}
}
diff --git a/vendor/symfony/http-kernel/Kernel.php b/vendor/symfony/http-kernel/Kernel.php
index 3c740e45ef..be20edd8ad 100644
--- a/vendor/symfony/http-kernel/Kernel.php
+++ b/vendor/symfony/http-kernel/Kernel.php
@@ -67,11 +67,11 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
private $requestStackSize = 0;
private $resetServices = false;
- const VERSION = '3.4.12';
- const VERSION_ID = 30412;
+ const VERSION = '3.4.13';
+ const VERSION_ID = 30413;
const MAJOR_VERSION = 3;
const MINOR_VERSION = 4;
- const RELEASE_VERSION = 12;
+ const RELEASE_VERSION = 13;
const EXTRA_VERSION = '';
const END_OF_MAINTENANCE = '11/2020';
@@ -232,7 +232,7 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
}
if (!$first && !$noDeprecation) {
- @trigger_error(sprintf('Passing "false" as the second argument to %s() is deprecated as of 3.4 and will be removed in 4.0.', __METHOD__), E_USER_DEPRECATED);
+ @trigger_error(sprintf('Passing "false" as the second argument to "%s()" is deprecated as of 3.4 and will be removed in 4.0.', __METHOD__), E_USER_DEPRECATED);
}
if (!isset($this->bundleMap[$name])) {
@@ -734,7 +734,7 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
protected function getEnvParameters()
{
if (0 === func_num_args() || func_get_arg(0)) {
- @trigger_error(sprintf('The %s() method is deprecated as of 3.3 and will be removed in 4.0. Use the %%env()%% syntax to get the value of any environment variable from configuration files instead.', __METHOD__), E_USER_DEPRECATED);
+ @trigger_error(sprintf('The "%s()" method is deprecated as of 3.3 and will be removed in 4.0. Use the %%env()%% syntax to get the value of any environment variable from configuration files instead.', __METHOD__), E_USER_DEPRECATED);
}
$parameters = array();
diff --git a/vendor/symfony/http-kernel/Tests/EventListener/TestSessionListenerTest.php b/vendor/symfony/http-kernel/Tests/EventListener/TestSessionListenerTest.php
index 22a2b71239..01f0a3b864 100644
--- a/vendor/symfony/http-kernel/Tests/EventListener/TestSessionListenerTest.php
+++ b/vendor/symfony/http-kernel/Tests/EventListener/TestSessionListenerTest.php
@@ -106,6 +106,36 @@ class TestSessionListenerTest extends TestCase
$this->assertNotEmpty($response->headers->getCookies());
}
+ /**
+ * @dataProvider anotherCookieProvider
+ */
+ public function testSessionWithNewSessionIdAndNewCookieDoesNotSendAnotherCookie($existing, array $expected)
+ {
+ $this->sessionHasBeenStarted();
+ $this->sessionIsEmpty();
+ $this->fixSessionId('456');
+
+ $kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\HttpKernelInterface')->getMock();
+ $request = Request::create('/', 'GET', array(), array('MOCKSESSID' => '123'));
+ $event = new GetResponseEvent($kernel, $request, HttpKernelInterface::MASTER_REQUEST);
+ $this->listener->onKernelRequest($event);
+
+ $response = new Response('', 200, array('Set-Cookie' => $existing));
+
+ $response = $this->filterResponse(new Request(), HttpKernelInterface::MASTER_REQUEST, $response);
+
+ $this->assertSame($expected, $response->headers->get('Set-Cookie', null, false));
+ }
+
+ public function anotherCookieProvider()
+ {
+ return array(
+ 'same' => array('MOCKSESSID=789; path=/', array('MOCKSESSID=789; path=/')),
+ 'different domain' => array('MOCKSESSID=789; path=/; domain=example.com', array('MOCKSESSID=789; path=/; domain=example.com', 'MOCKSESSID=456; path=/')),
+ 'different path' => array('MOCKSESSID=789; path=/foo', array('MOCKSESSID=789; path=/foo', 'MOCKSESSID=456; path=/')),
+ );
+ }
+
public function testUnstartedSessionIsNotSave()
{
$this->sessionHasNotBeenStarted();
@@ -123,10 +153,10 @@ class TestSessionListenerTest extends TestCase
$this->assertFalse(is_subclass_of(TestSessionListener::class, ServiceSubscriberInterface::class, 'Implementing ServiceSubscriberInterface would create a dep on the DI component, which eg Silex cannot afford'));
}
- private function filterResponse(Request $request, $type = HttpKernelInterface::MASTER_REQUEST)
+ private function filterResponse(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, Response $response = null)
{
$request->setSession($this->session);
- $response = new Response();
+ $response = $response ?: new Response();
$kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\HttpKernelInterface')->getMock();
$event = new FilterResponseEvent($kernel, $request, $type, $response);
diff --git a/vendor/symfony/http-kernel/Tests/Fragment/HIncludeFragmentRendererTest.php b/vendor/symfony/http-kernel/Tests/Fragment/HIncludeFragmentRendererTest.php
index 1be052e5e6..7171c71bc3 100644
--- a/vendor/symfony/http-kernel/Tests/Fragment/HIncludeFragmentRendererTest.php
+++ b/vendor/symfony/http-kernel/Tests/Fragment/HIncludeFragmentRendererTest.php
@@ -86,4 +86,17 @@ class HIncludeFragmentRendererTest extends TestCase
$strategy = new HIncludeFragmentRenderer($engine);
$this->assertEquals('<hx:include src="/foo">default</hx:include>', $strategy->render('/foo', Request::create('/'), array('default' => 'default'))->getContent());
}
+
+ public function testRenderWithEngineAndDefaultText()
+ {
+ $engine = $this->getMockBuilder('Symfony\\Component\\Templating\\EngineInterface')->getMock();
+ $engine->expects($this->once())
+ ->method('exists')
+ ->with('loading...')
+ ->will($this->throwException(new \RuntimeException()));
+
+ // only default
+ $strategy = new HIncludeFragmentRenderer($engine);
+ $this->assertEquals('<hx:include src="/foo">loading...</hx:include>', $strategy->render('/foo', Request::create('/'), array('default' => 'loading...'))->getContent());
+ }
}
diff --git a/vendor/symfony/http-kernel/Tests/KernelTest.php b/vendor/symfony/http-kernel/Tests/KernelTest.php
index 7cde2ac5e2..916cf8d24d 100644
--- a/vendor/symfony/http-kernel/Tests/KernelTest.php
+++ b/vendor/symfony/http-kernel/Tests/KernelTest.php
@@ -809,7 +809,7 @@ EOF;
/**
* @group legacy
- * @expectedDeprecation The Symfony\Component\HttpKernel\Kernel::getEnvParameters() method is deprecated as of 3.3 and will be removed in 4.0. Use the %cenv()%c syntax to get the value of any environment variable from configuration files instead.
+ * @expectedDeprecation The "Symfony\Component\HttpKernel\Kernel::getEnvParameters()" method is deprecated as of 3.3 and will be removed in 4.0. Use the %cenv()%c syntax to get the value of any environment variable from configuration files instead.
* @expectedDeprecation The support of special environment variables that start with SYMFONY__ (such as "SYMFONY__FOO__BAR") is deprecated as of 3.3 and will be removed in 4.0. Use the %cenv()%c syntax instead to get the value of environment variables in configuration files.
*/
public function testSymfonyEnvironmentVariables()