Skip to content

Commit ce22a97

Browse files
committed
minor #53255 [Validator] Update Charset constraint message (alexandre-daubois)
This PR was merged into the 7.1 branch. Discussion ---------- [Validator] Update `Charset` constraint message | Q | A | ------------- | --- | Branch? | 7.1 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | - | License | MIT After #53253 (comment) Commits ------- 1c170f9 [Validator] Update `Charset` constraint message
2 parents 367be4b + 1c170f9 commit ce22a97

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Symfony/Component/Validator/Constraints/Charset.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ final class Charset extends Constraint
2727
];
2828

2929
public array|string $encodings = [];
30-
public string $message = 'The detected encoding "{{ detected }}" does not match one of the accepted encoding: "{{ encodings }}".';
30+
public string $message = 'The detected character encoding "{{ detected }}" is invalid. Allowed encodings are "{{ encodings }}".';
3131

3232
public function __construct(array|string $encodings = null, string $message = null, array $groups = null, mixed $payload = null, array $options = null)
3333
{

src/Symfony/Component/Validator/Tests/Constraints/CharsetValidatorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function testInvalidValues(string $value, array $encodings)
4040
{
4141
$this->validator->validate($value, new Charset(encodings: $encodings));
4242

43-
$this->buildViolation('The detected encoding "{{ detected }}" does not match one of the accepted encoding: "{{ encodings }}".')
43+
$this->buildViolation('The detected character encoding "{{ detected }}" is invalid. Allowed encodings are "{{ encodings }}".')
4444
->setParameter('{{ detected }}', mb_detect_encoding($value, $encodings, true))
4545
->setParameter('{{ encodings }}', implode(', ', $encodings))
4646
->setCode(Charset::BAD_ENCODING_ERROR)

0 commit comments

Comments
 (0)