diff --git a/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md b/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md
index 6bb39e9f0e..2f9378e163 100644
--- a/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md
+++ b/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md
@@ -134,7 +134,7 @@ CHANGELOG
The default value will be `state_machine` in Symfony 4.0.
* Deprecated the `CompilerDebugDumpPass` class
* Deprecated the "framework.trusted_proxies" configuration option and the corresponding "kernel.trusted_proxies" parameter
- * Added a new new version strategy option called json_manifest_path
+ * Added a new version strategy option called "json_manifest_path"
that allows you to use the `JsonManifestVersionStrategy`.
* Added `Symfony\Bundle\FrameworkBundle\Controller\AbstractController`. It provides
the same helpers as the `Controller` class, but does not allow accessing the dependency
diff --git a/src/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeExtensionGuesser.php b/src/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeExtensionGuesser.php
index d5acb34094..c0f9140c80 100644
--- a/src/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeExtensionGuesser.php
+++ b/src/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeExtensionGuesser.php
@@ -808,6 +808,12 @@ class MimeTypeExtensionGuesser implements ExtensionGuesserInterface
*/
public function guess($mimeType)
{
- return isset($this->defaultExtensions[$mimeType]) ? $this->defaultExtensions[$mimeType] : null;
+ if (isset($this->defaultExtensions[$mimeType])) {
+ return $this->defaultExtensions[$mimeType];
+ }
+
+ $lcMimeType = strtolower($mimeType);
+
+ return isset($this->defaultExtensions[$lcMimeType]) ? $this->defaultExtensions[$lcMimeType] : null;
}
}
diff --git a/src/Symfony/Component/HttpFoundation/Tests/File/Fixtures/case-sensitive-mime-type.xlsm b/src/Symfony/Component/HttpFoundation/Tests/File/Fixtures/case-sensitive-mime-type.xlsm
new file mode 100644
index 0000000000..94d85e6132
Binary files /dev/null and b/src/Symfony/Component/HttpFoundation/Tests/File/Fixtures/case-sensitive-mime-type.xlsm differ
diff --git a/src/Symfony/Component/HttpFoundation/Tests/File/UploadedFileTest.php b/src/Symfony/Component/HttpFoundation/Tests/File/UploadedFileTest.php
index 3952a69c69..8f5f48a066 100644
--- a/src/Symfony/Component/HttpFoundation/Tests/File/UploadedFileTest.php
+++ b/src/Symfony/Component/HttpFoundation/Tests/File/UploadedFileTest.php
@@ -94,6 +94,18 @@ class UploadedFileTest extends TestCase
$this->assertEquals('jpeg', $file->guessClientExtension());
}
+ public function testCaseSensitiveMimeType()
+ {
+ $file = new UploadedFile(
+ __DIR__.'/Fixtures/case-sensitive-mime-type.xlsm',
+ 'test.xlsm',
+ 'application/vnd.ms-excel.sheet.macroEnabled.12',
+ null
+ );
+
+ $this->assertEquals('xlsm', $file->guessClientExtension());
+ }
+
public function testErrorIsOkByDefault()
{
$file = new UploadedFile(
diff --git a/src/Symfony/Component/Ldap/Tests/LdapTestCase.php b/src/Symfony/Component/Ldap/Tests/LdapTestCase.php
index 2e5fa9a34b..cc50ecae73 100644
--- a/src/Symfony/Component/Ldap/Tests/LdapTestCase.php
+++ b/src/Symfony/Component/Ldap/Tests/LdapTestCase.php
@@ -8,6 +8,14 @@ class LdapTestCase extends TestCase
{
protected function getLdapConfig()
{
+ $h = @ldap_connect(getenv('LDAP_HOST'), getenv('LDAP_PORT'));
+
+ if (!$h || !@ldap_bind($h)) {
+ $this->markTestSkipped('No server is listening on LDAP_HOST:LDAP_PORT');
+ }
+
+ ldap_close($h);
+
return [
'host' => getenv('LDAP_HOST'),
'port' => getenv('LDAP_PORT'),
diff --git a/src/Symfony/Component/Security/Http/Firewall/ExceptionListener.php b/src/Symfony/Component/Security/Http/Firewall/ExceptionListener.php
index 08e08f7454..2aa3ac621f 100644
--- a/src/Symfony/Component/Security/Http/Firewall/ExceptionListener.php
+++ b/src/Symfony/Component/Security/Http/Firewall/ExceptionListener.php
@@ -131,6 +131,8 @@ class ExceptionListener
} catch (\Exception $e) {
$event->setException($e);
}
+
+ return;
}
if (null !== $this->logger) {
@@ -148,7 +150,7 @@ class ExceptionListener
$subRequest = $this->httpUtils->createRequest($event->getRequest(), $this->errorPage);
$subRequest->attributes->set(Security::ACCESS_DENIED_ERROR, $exception);
- $event->setResponse($event->getKernel()->handle($subRequest, HttpKernelInterface::SUB_REQUEST));
+ $event->setResponse($event->getKernel()->handle($subRequest, HttpKernelInterface::SUB_REQUEST, true));
$event->allowCustomResponseCode();
}
} catch (\Exception $e) {
diff --git a/src/Symfony/Component/Security/Http/Tests/Firewall/ExceptionListenerTest.php b/src/Symfony/Component/Security/Http/Tests/Firewall/ExceptionListenerTest.php
index 3220e43e70..53fedebcad 100644
--- a/src/Symfony/Component/Security/Http/Tests/Firewall/ExceptionListenerTest.php
+++ b/src/Symfony/Component/Security/Http/Tests/Firewall/ExceptionListenerTest.php
@@ -130,8 +130,10 @@ class ExceptionListenerTest extends TestCase
{
$event = $this->createEvent($exception);
- $listener = $this->createExceptionListener(null, $this->createTrustResolver(true), null, null, null, $this->createCustomAccessDeniedHandler(new Response('error')));
+ $accessDeniedHandler = $this->getMockBuilder('Symfony\Component\Security\Http\Authorization\AccessDeniedHandlerInterface')->getMock();
+ $accessDeniedHandler->expects($this->once())->method('handle')->will($this->returnValue(new Response('error')));
+ $listener = $this->createExceptionListener(null, $this->createTrustResolver(true), null, null, null, $accessDeniedHandler);
$listener->onKernelException($event);
$this->assertEquals('error', $event->getResponse()->getContent());
@@ -145,51 +147,16 @@ class ExceptionListenerTest extends TestCase
{
$event = $this->createEvent($exception);
- $listener = $this->createExceptionListener($this->createTokenStorage(), $this->createTrustResolver(false), null, $this->createEntryPoint());
+ $tokenStorage = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface')->getMock();
+ $tokenStorage->expects($this->once())->method('getToken')->will($this->returnValue($this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\TokenInterface')->getMock()));
+
+ $listener = $this->createExceptionListener($tokenStorage, $this->createTrustResolver(false), null, $this->createEntryPoint());
$listener->onKernelException($event);
$this->assertEquals('OK', $event->getResponse()->getContent());
$this->assertSame(null === $eventException ? $exception : $eventException, $event->getException()->getPrevious());
}
- /**
- * @dataProvider getAccessDeniedExceptionProvider
- */
- public function testAccessDeniedExceptionNotFullFledgedAndWithAccessDeniedHandlerAndWithoutErrorPage(\Exception $exception, \Exception $eventException = null)
- {
- $event = $this->createEvent($exception);
-
- $listener = $this->createExceptionListener($this->createTokenStorage(), $this->createTrustResolver(false), null, $this->createEntryPoint(), null, $this->createCustomAccessDeniedHandler(new Response('denied', 403)));
- $listener->onKernelException($event);
-
- $this->assertEquals('denied', $event->getResponse()->getContent());
- $this->assertEquals(403, $event->getResponse()->getStatusCode());
- $this->assertSame(null === $eventException ? $exception : $eventException, $event->getException()->getPrevious());
- }
-
- /**
- * @dataProvider getAccessDeniedExceptionProvider
- */
- public function testAccessDeniedExceptionNotFullFledgedAndWithoutAccessDeniedHandlerAndWithErrorPage(\Exception $exception, \Exception $eventException = null)
- {
- $kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\HttpKernelInterface')->getMock();
- $kernel->expects($this->once())->method('handle')->will($this->returnValue(new Response('Unauthorized', 401)));
-
- $event = $this->createEvent($exception, $kernel);
-
- $httpUtils = $this->getMockBuilder('Symfony\Component\Security\Http\HttpUtils')->getMock();
- $httpUtils->expects($this->once())->method('createRequest')->will($this->returnValue(Request::create('/error')));
-
- $listener = $this->createExceptionListener($this->createTokenStorage(), $this->createTrustResolver(true), $httpUtils, null, '/error');
- $listener->onKernelException($event);
-
- $this->assertTrue($event->isAllowingCustomResponseCode());
-
- $this->assertEquals('Unauthorized', $event->getResponse()->getContent());
- $this->assertEquals(401, $event->getResponse()->getStatusCode());
- $this->assertSame(null === $eventException ? $exception : $eventException, $event->getException()->getPrevious());
- }
-
public function getAccessDeniedExceptionProvider()
{
return [
@@ -201,22 +168,6 @@ class ExceptionListenerTest extends TestCase
];
}
- private function createTokenStorage()
- {
- $tokenStorage = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface')->getMock();
- $tokenStorage->expects($this->once())->method('getToken')->will($this->returnValue($this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\TokenInterface')->getMock()));
-
- return $tokenStorage;
- }
-
- private function createCustomAccessDeniedHandler(Response $response)
- {
- $accessDeniedHandler = $this->getMockBuilder('Symfony\Component\Security\Http\Authorization\AccessDeniedHandlerInterface')->getMock();
- $accessDeniedHandler->expects($this->once())->method('handle')->will($this->returnValue($response));
-
- return $accessDeniedHandler;
- }
-
private function createEntryPoint(Response $response = null)
{
$entryPoint = $this->getMockBuilder('Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface')->getMock();
diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.tl.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.tl.xlf
index 75dc329589..1c408585b2 100644
--- a/src/Symfony/Component/Validator/Resources/translations/validators.tl.xlf
+++ b/src/Symfony/Component/Validator/Resources/translations/validators.tl.xlf
@@ -314,6 +314,54 @@
This is not a valid Business Identifier Code (BIC).Ito ay hindi isang balidong Business Identifier Code (BIC).
+
+ Error
+ Error
+
+
+ This is not a valid UUID.
+ Ito ay hindi wastong UUID.
+
+
+ This value should be a multiple of {{ compared_value }}.
+ Ang halagang ito ay dapat multiple ng {{ compared_value }}.
+
+
+ This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}.
+ Ang Business Identifier Code (BIC) na ito ay walang kaugnayan sa IBAN {{ iban }}.
+
+
+ This value should be valid JSON.
+ Ang halagang ito ay dapat naka wastong JSON.
+
+
+ This collection should contain only unique elements.
+ Ang mga elemento ng koleksyong ito ay dapat magkakaiba.
+
+
+ This value should be positive.
+ Ang halagang ito ay dapat positibo.
+
+
+ This value should be either positive or zero.
+ Ang halagang ito ay dapat positibo o zero.
+
+
+ This value should be negative.
+ Ang halagang ito ay dapat negatibo.
+
+
+ This value should be either negative or zero.
+ Ang halagang ito ay dapat negatibo o zero.
+
+
+ This value is not a valid timezone.
+ Ang halagang ito ay hindi wastong timezone.
+
+
+ This password has been leaked in a data breach, it must not be used. Please use another password.
+ Naikalat ang password na ito sa isang data breach at hindi na dapat gamitin. Mangyaring gumamit ng ibang pang password.
+