diff --git a/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_layout.html.twig b/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_layout.html.twig index af42cfc73d..03335315e9 100644 --- a/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_layout.html.twig +++ b/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_layout.html.twig @@ -114,7 +114,6 @@
{{- form_label(form) }} {# -#} {{ form_widget(form, widget_attr) }} {# -#} - {{ form_widget(form) }} {# -#} {{ form_errors(form) }} {# -#}
{# -#} {%- endblock form_row %} diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationDebugCommandTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationDebugCommandTest.php index ba11f53f3a..7253215c55 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationDebugCommandTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationDebugCommandTest.php @@ -68,7 +68,7 @@ class TranslationDebugCommandTest extends TestCase /** * @group legacy * @expectedDeprecation Storing translations in the "%ssf_translation%s/Resources/translations" directory is deprecated since Symfony 4.2, use the "%ssf_translation%s/translations" directory instead. - * @expectedDeprecation Storing templates in the "%ssf_translation%s/Resources/views" directory is deprecated since Symfony 4.2, use the "%ssf_translation%s/templates" directory instead. + * @expectedDeprecation Loading Twig templates from the "%ssf_translation%s/Resources/views" directory is deprecated since Symfony 4.2, use the "%ssf_translation%s/templates" directory instead. */ public function testDebugLegacyDefaultDirectory() { diff --git a/src/Symfony/Component/Debug/ExceptionHandler.php b/src/Symfony/Component/Debug/ExceptionHandler.php index 18d56f3469..6eb2932d16 100644 --- a/src/Symfony/Component/Debug/ExceptionHandler.php +++ b/src/Symfony/Component/Debug/ExceptionHandler.php @@ -385,7 +385,7 @@ EOF; $fmt = $this->fileLinkFormat ?: ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format'); if (!$fmt) { - return sprintf('in %s%s', $this->escapeHtml($path), $file, 0 < $line ? ' line '.$line : ''); + return sprintf('in %s%s', $this->escapeHtml($path), $file, 0 < $line ? ' line '.$line : ''); } if (\is_string($fmt)) { @@ -401,7 +401,11 @@ EOF; $link = strtr($fmt[0], ['%f' => $path, '%l' => $line]); } else { - $link = $fmt->format($path, $line); + try { + $link = $fmt->format($path, $line); + } catch (\Exception $e) { + return sprintf('in %s%s', $this->escapeHtml($path), $file, 0 < $line ? ' line '.$line : ''); + } } return sprintf('in %s%s', $this->escapeHtml($link), $file, 0 < $line ? ' line '.$line : ''); diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/Type/FileTypeTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/Type/FileTypeTest.php index 3c0a38d1b0..311529c294 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/Type/FileTypeTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/Type/FileTypeTest.php @@ -25,7 +25,7 @@ class FileTypeTest extends BaseTypeTest protected function getExtensions() { - $translator = $this->createMock(TranslatorInterface::class); + $translator = $this->getMockBuilder(TranslatorInterface::class)->getMock(); $translator->expects($this->any())->method('trans')->willReturnArgument(0); return array_merge(parent::getExtensions(), [new CoreExtension(null, null, $translator)]); @@ -199,11 +199,12 @@ class FileTypeTest extends BaseTypeTest */ public function testFailedFileUploadIsTurnedIntoFormErrorUsingHttpFoundationRequestHandler($errorCode, $expectedErrorMessage) { + $requestHandler = new HttpFoundationRequestHandler(); $form = $this->factory ->createBuilder(static::TESTED_TYPE) - ->setRequestHandler(new HttpFoundationRequestHandler()) + ->setRequestHandler($requestHandler) ->getForm(); - $form->submit(new UploadedFile(__DIR__.'/../../../Fixtures/foo', 'foo', null, null, $errorCode, true)); + $form->submit($this->createUploadedFile($requestHandler, __DIR__.'/../../../Fixtures/foo', 'foo', $errorCode)); if (UPLOAD_ERR_OK === $errorCode) { $this->assertTrue($form->isValid()); @@ -243,15 +244,16 @@ class FileTypeTest extends BaseTypeTest */ public function testMultipleSubmittedFailedFileUploadsAreTurnedIntoFormErrorUsingHttpFoundationRequestHandler($errorCode, $expectedErrorMessage) { + $requestHandler = new HttpFoundationRequestHandler(); $form = $this->factory ->createBuilder(static::TESTED_TYPE, null, [ 'multiple' => true, ]) - ->setRequestHandler(new HttpFoundationRequestHandler()) + ->setRequestHandler($requestHandler) ->getForm(); $form->submit([ - new UploadedFile(__DIR__.'/../../../Fixtures/foo', 'foo', null, null, $errorCode, true), - new UploadedFile(__DIR__.'/../../../Fixtures/foo', 'bar', null, null, $errorCode, true), + $this->createUploadedFile($requestHandler, __DIR__.'/../../../Fixtures/foo', 'foo', $errorCode), + $this->createUploadedFile($requestHandler, __DIR__.'/../../../Fixtures/foo', 'bar', $errorCode), ]); if (UPLOAD_ERR_OK === $errorCode) { @@ -316,15 +318,21 @@ class FileTypeTest extends BaseTypeTest ]; } - private function createUploadedFile(RequestHandlerInterface $requestHandler, $path, $originalName) + private function createUploadedFile(RequestHandlerInterface $requestHandler, $path, $originalName, $errorCode = 0) { if ($requestHandler instanceof HttpFoundationRequestHandler) { - return new UploadedFile($path, $originalName, null, null, true); + $class = new \ReflectionClass(UploadedFile::class); + + if (5 === $class->getConstructor()->getNumberOfParameters()) { + return new UploadedFile($path, $originalName, null, $errorCode, true); + } + + return new UploadedFile($path, $originalName, null, null, $errorCode, true); } return [ 'name' => $originalName, - 'error' => 0, + 'error' => $errorCode, 'type' => 'text/plain', 'tmp_name' => $path, 'size' => null, diff --git a/src/Symfony/Component/Form/Tests/Extension/HttpFoundation/HttpFoundationRequestHandlerTest.php b/src/Symfony/Component/Form/Tests/Extension/HttpFoundation/HttpFoundationRequestHandlerTest.php index 0e5389568e..dc082505a1 100644 --- a/src/Symfony/Component/Form/Tests/Extension/HttpFoundation/HttpFoundationRequestHandlerTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/HttpFoundation/HttpFoundationRequestHandlerTest.php @@ -59,6 +59,12 @@ class HttpFoundationRequestHandlerTest extends AbstractRequestHandlerTest protected function getFailedUploadedFile($errorCode) { + $class = new \ReflectionClass(UploadedFile::class); + + if (5 === $class->getConstructor()->getNumberOfParameters()) { + return new UploadedFile(__DIR__.'/../../Fixtures/foo', 'foo', null, $errorCode, true); + } + return new UploadedFile(__DIR__.'/../../Fixtures/foo', 'foo', null, null, $errorCode, true); } } diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.de.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.de.xlf index 64543d5e8d..f33e4d602c 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.de.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.de.xlf @@ -335,29 +335,33 @@ Dieser Wert sollte gültiges JSON sein. - This value should be positive. - Dieser Wert sollte positiv sein. - - - This value should be either positive or zero. - Dieser Wert sollte entweder positiv oder 0 sein. - - - This value should be negative. - Dieser Wert sollte negativ sein. - - - This value should be either negative or zero. - Dieser Wert sollte entweder negativ oder 0 sein. - - This collection should contain only unique elements. Diese Sammlung darf keine doppelten Elemente enthalten. + + This value should be positive. + Diese Zahl sollte positiv sein. + + + This value should be either positive or zero. + Diese Zahl sollte entweder positiv oder 0 sein. + + + This value should be negative. + Diese Zahl sollte negativ sein. + + + This value should be either negative or zero. + Diese Zahl sollte entweder negativ oder 0 sein. + This value is not a valid timezone. Dieser Wert ist keine gültige Zeitzone. + + This password has been leaked in a data breach, it must not be used. Please use another password. + Dieses Passwort ist Teil eines Datenlecks, es darf nicht verwendet werden. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.en.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.en.xlf index d74b0fefca..d5d9d20997 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.en.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.en.xlf @@ -335,29 +335,33 @@ This value should be valid JSON. + This collection should contain only unique elements. + This collection should contain only unique elements. + + This value should be positive. This value should be positive. - + This value should be either positive or zero. This value should be either positive or zero. - + This value should be negative. This value should be negative. - + This value should be either negative or zero. This value should be either negative or zero. - - This collection should contain only unique elements. - This collection should contain only unique elements. - This value is not a valid timezone. This value is not a valid timezone. + + This password has been leaked in a data breach, it must not be used. Please use another password. + This password has been leaked in a data breach, it must not be used. Please use another password. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.vi.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.vi.xlf index 58ed8c9568..95dd7d6665 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.vi.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.vi.xlf @@ -335,25 +335,33 @@ Giá trị này nên đúng định dạng JSON. - This value should be positive. - Giá trị này có thể thực hiện được. - - - This value should be either positive or zero. - Giá trị này có thể thực hiện được hoặc bằng không. - - - This value should be negative. - Giá trị này nên bị từ chối. - - - This value should be either negative or zero. - Giá trị này nên bị từ chối hoặc bằng không. - - This collection should contain only unique elements. Danh sách này chỉ nên chứa các phần tử khác nhau. + + This value should be positive. + Giá trị này có thể thực hiện được. + + + This value should be either positive or zero. + Giá trị này có thể thực hiện được hoặc bằng không. + + + This value should be negative. + Giá trị này nên bị từ chối. + + + This value should be either negative or zero. + Giá trị này nên bị từ chối hoặc bằng không. + + + This value is not a valid timezone. + Giá trị này không phải là múi giờ hợp lệ. + + + This password has been leaked in a data breach, it must not be used. Please use another password. + Mật khẩu này đã bị rò rỉ dữ liệu, không được sử dụng nữa. Xin vui lòng sử dụng mật khẩu khác. +