From e83886c81193bf259768a509ebb94bfbc2bac70e Mon Sep 17 00:00:00 2001 From: Toni Peric Date: Sat, 1 Jun 2019 15:18:31 +0200 Subject: [PATCH 1/6] Add missing translations --- .../Resources/translations/validators.hr.xlf | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.hr.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.hr.xlf index 60f02435f5..ccc0c0135a 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.hr.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.hr.xlf @@ -334,6 +334,34 @@ This value should be valid JSON. Ova vrijednost treba biti validan JSON. + + This collection should contain only unique elements. + Ova kolekcija treba sadržavati samo unikatne elemente. + + + This value should be positive. + Ova vrijednost treba biti pozitivna. + + + This value should be either positive or zero. + Ova vrijednost treba biti pozitivna ili jednaka nuli. + + + This value should be negative. + Ova vrijednost treba biti negativna. + + + This value should be either negative or zero. + Ova vrijednost treba biti negativna ili jednaka nuli. + + + This value is not a valid timezone. + Ova vrijednost nije validna vremenska zona. + + + This password has been leaked in a data breach, it must not be used. Please use another password. + Ova lozinka je procurila u nekom od sigurnosnih propusta, te je potrebno koristiti drugu lozinku. + From 2b95fcaa6b308342a98f7dbd1e7ddf581d40fdb5 Mon Sep 17 00:00:00 2001 From: Massimiliano Arione Date: Mon, 3 Jun 2019 10:51:36 +0200 Subject: [PATCH 2/6] update italian validator translation --- .../Resources/translations/validators.it.xlf | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.it.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.it.xlf index 235d44d1bb..ca0b177586 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.it.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.it.xlf @@ -330,6 +330,38 @@ This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. Questo codice identificativo bancario (BIC) non è associato all'IBAN {{ iban }}. + + This value should be valid JSON. + Questo valore dovrebbe essere un JSON valido. + + + This collection should contain only unique elements. + Questa collezione dovrebbe contenere solo elementi unici. + + + This value should be positive. + Questo valore dovrebbe essere positivo. + + + This value should be either positive or zero. + Questo valore dovrebbe essere positivo oppure zero. + + + This value should be negative. + Questo valore dovrebbe essere negativo. + + + This value should be either negative or zero. + Questo valore dovrebbe essere negativo oppure zero. + + + This value is not a valid timezone. + Questo valore non è un fuso orario valido. + + + This password has been leaked in a data breach, it must not be used. Please use another password. + Questa password è trapelata durante una compromissione di dati, non deve essere usata. Si prega di usre una password diversa. + From b37c1a818f8cea12ff8c91b9a41626ad678b7b06 Mon Sep 17 00:00:00 2001 From: Massimiliano Arione Date: Mon, 3 Jun 2019 11:50:31 +0200 Subject: [PATCH 3/6] fix typo in PR #31802 --- .../Validator/Resources/translations/validators.it.xlf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.it.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.it.xlf index ca0b177586..f4c188d1dd 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.it.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.it.xlf @@ -360,7 +360,7 @@ This password has been leaked in a data breach, it must not be used. Please use another password. - Questa password è trapelata durante una compromissione di dati, non deve essere usata. Si prega di usre una password diversa. + Questa password è trapelata durante una compromissione di dati, non deve essere usata. Si prega di usare una password diversa. From 648c6949fc1360247a86418317f38f77fb303de5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Pineau?= Date: Mon, 3 Jun 2019 17:30:31 +0200 Subject: [PATCH 4/6] Simplify code - catch \Throwable capture all exceptions This is a legacy when we did support PHP 5.X --- src/Symfony/Component/Filesystem/Filesystem.php | 1 - src/Symfony/Component/HttpKernel/Kernel.php | 2 -- 2 files changed, 3 deletions(-) diff --git a/src/Symfony/Component/Filesystem/Filesystem.php b/src/Symfony/Component/Filesystem/Filesystem.php index 082084b4d9..9ec1e94354 100644 --- a/src/Symfony/Component/Filesystem/Filesystem.php +++ b/src/Symfony/Component/Filesystem/Filesystem.php @@ -750,7 +750,6 @@ class Filesystem return $result; } catch (\Throwable $e) { - } catch (\Exception $e) { } \restore_error_handler(); diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index 14257d0f60..4e316cdfdc 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -487,7 +487,6 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl $fresh = true; } } catch (\Throwable $e) { - } catch (\Exception $e) { } finally { error_reporting($errorLevel); } @@ -556,7 +555,6 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl try { $oldContainer = include $cache->getPath(); } catch (\Throwable $e) { - } catch (\Exception $e) { } finally { error_reporting($errorLevel); } From 0e741f960064e12e3383098b80294864a8f359b6 Mon Sep 17 00:00:00 2001 From: Massimiliano Arione Date: Mon, 3 Jun 2019 15:30:08 +0200 Subject: [PATCH 5/6] fix type hint for salt in PasswordEncoderInterface --- .../Security/Core/Encoder/BasePasswordEncoder.php | 4 ++-- .../Security/Core/Encoder/PasswordEncoderInterface.php | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Symfony/Component/Security/Core/Encoder/BasePasswordEncoder.php b/src/Symfony/Component/Security/Core/Encoder/BasePasswordEncoder.php index 3c3ea1aa17..3a5c4f0c4b 100644 --- a/src/Symfony/Component/Security/Core/Encoder/BasePasswordEncoder.php +++ b/src/Symfony/Component/Security/Core/Encoder/BasePasswordEncoder.php @@ -48,8 +48,8 @@ abstract class BasePasswordEncoder implements PasswordEncoderInterface /** * Merges a password and a salt. * - * @param string $password The password to be used - * @param string $salt The salt to be used + * @param string $password The password to be used + * @param string|null $salt The salt to be used * * @return string a merged password and salt * diff --git a/src/Symfony/Component/Security/Core/Encoder/PasswordEncoderInterface.php b/src/Symfony/Component/Security/Core/Encoder/PasswordEncoderInterface.php index e0573051eb..03cdaca44a 100644 --- a/src/Symfony/Component/Security/Core/Encoder/PasswordEncoderInterface.php +++ b/src/Symfony/Component/Security/Core/Encoder/PasswordEncoderInterface.php @@ -23,8 +23,8 @@ interface PasswordEncoderInterface /** * Encodes the raw password. * - * @param string $raw The password to encode - * @param string $salt The salt + * @param string $raw The password to encode + * @param string|null $salt The salt * * @return string The encoded password * @@ -36,9 +36,9 @@ interface PasswordEncoderInterface /** * Checks a raw password against an encoded password. * - * @param string $encoded An encoded password - * @param string $raw A raw password - * @param string $salt The salt + * @param string $encoded An encoded password + * @param string $raw A raw password + * @param string|null $salt The salt * * @return bool true if the password is valid, false otherwise * From ec690b214580c2974183563a56727bc82d68f200 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Sat, 1 Jun 2019 15:16:50 +0200 Subject: [PATCH 6/6] [Translation] Fixed case sensitivity of lint:xliff command --- .../Translation/Command/XliffLintCommand.php | 4 +++- .../Tests/Command/XliffLintCommandTest.php | 11 +++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/Translation/Command/XliffLintCommand.php b/src/Symfony/Component/Translation/Command/XliffLintCommand.php index 9bea4d9499..3c2cc9efde 100644 --- a/src/Symfony/Component/Translation/Command/XliffLintCommand.php +++ b/src/Symfony/Component/Translation/Command/XliffLintCommand.php @@ -124,7 +124,9 @@ EOF $normalizedLocale = preg_quote(str_replace('-', '_', $targetLanguage), '/'); // strict file names require translation files to be named '____.locale.xlf' // otherwise, both '____.locale.xlf' and 'locale.____.xlf' are allowed - $expectedFilenamePattern = $this->requireStrictFileNames ? sprintf('/^.*\.%s\.xlf/', $normalizedLocale) : sprintf('/^(.*\.%s\.xlf|%s\..*\.xlf)/', $normalizedLocale, $normalizedLocale); + // also, the regexp matching must be case-insensitive, as defined for 'target-language' values + // http://docs.oasis-open.org/xliff/v1.2/os/xliff-core.html#target-language + $expectedFilenamePattern = $this->requireStrictFileNames ? sprintf('/^.*\.(?i:%s)\.xlf/', $normalizedLocale) : sprintf('/^(.*\.(?i:%s)\.xlf|(?i:%s)\..*\.xlf)/', $normalizedLocale, $normalizedLocale); if (0 === preg_match($expectedFilenamePattern, basename($file))) { $errors[] = [ diff --git a/src/Symfony/Component/Translation/Tests/Command/XliffLintCommandTest.php b/src/Symfony/Component/Translation/Tests/Command/XliffLintCommandTest.php index 516d98af53..df2e2f0951 100644 --- a/src/Symfony/Component/Translation/Tests/Command/XliffLintCommandTest.php +++ b/src/Symfony/Component/Translation/Tests/Command/XliffLintCommandTest.php @@ -94,6 +94,17 @@ class XliffLintCommandTest extends TestCase $this->assertContains('There is a mismatch between the language included in the file name ("messages.en.xlf") and the "es" value used in the "target-language" attribute of the file.', trim($tester->getDisplay())); } + public function testLintTargetLanguageIsCaseInsensitive() + { + $tester = $this->createCommandTester(); + $filename = $this->createFile('note', 'zh-cn', 'messages.zh_CN.xlf'); + + $tester->execute(['filename' => $filename], ['decorated' => false]); + + $this->assertEquals(0, $tester->getStatusCode()); + $this->assertContains('[OK] All 1 XLIFF files contain valid syntax.', trim($tester->getDisplay())); + } + /** * @expectedException \RuntimeException */