Skip to content

Commit

Permalink
bug #51726 [Validator] NoSuspiciousCharacters custom error messages f…
Browse files Browse the repository at this point in the history
…ix (bam1to)

This PR was merged into the 6.3 branch.

Discussion
----------

[Validator] NoSuspiciousCharacters custom error messages fix

| Q             | A
| ------------- | ---
| Branch?       | 6.3 for bug fixes <!-- see below -->
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix #51715  <!-- prefix each issue number with "Fix #", no need to create an issue if none exists, explain below instead -->
| License       | MIT
| Doc PR        | <!-- required for new features -->

We use the ?? operator to check if the entered constructor arguments are equal to null. The previous operator (??=) was incorrect because of the default messages' values.

Commits
-------

08e955f NoSuspiciousCharacters custom error messages fix
  • Loading branch information
nicolas-grekas committed Sep 27, 2023
2 parents 99726ff + 08e955f commit f47f589
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,12 @@ public function __construct(

parent::__construct($options, $groups, $payload);

$this->restrictionLevelMessage ??= $restrictionLevelMessage;
$this->invisibleMessage ??= $invisibleMessage;
$this->mixedNumbersMessage ??= $mixedNumbersMessage;
$this->hiddenOverlayMessage ??= $hiddenOverlayMessage;
$this->checks ??= $checks;
$this->restrictionLevel ??= $restrictionLevel;
$this->locales ??= $locales;
$this->restrictionLevelMessage = $restrictionLevelMessage ?? $this->restrictionLevelMessage;
$this->invisibleMessage = $invisibleMessage ?? $this->invisibleMessage;
$this->mixedNumbersMessage = $mixedNumbersMessage ?? $this->mixedNumbersMessage;
$this->hiddenOverlayMessage = $hiddenOverlayMessage ?? $this->hiddenOverlayMessage;
$this->checks = $checks ?? $this->checks;
$this->restrictionLevel = $restrictionLevel ?? $this->restrictionLevel;
$this->locales = $locales ?? $this->locales;
}
}

0 comments on commit f47f589

Please sign in to comment.