PluginProbe
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder / 6.2.14
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder v6.2.14
6.2.14 6.2.13 6.2.12 6.2.10 6.2.11 6.2.9 6.2.8 6.2.7 6.2.6 6.2.5 6.2.4 6.2.3 6.2.2 3.6.22 3.6.31 3.6.40 3.6.41 3.6.42 3.6.50 3.6.51 3.6.60 3.6.61 3.6.62 3.6.64 3.6.65 All 196 releases
← All changes | app/Services/Parser/Validations.php +17 -1 6.2.56.2.14 View file →
@@ -1,9 +1,8 @@
1 1 <?php
2 2
3 3 namespace FluentForm\App\Services\Parser;
4 4
5 -use FluentForm\App\Services\ConditionAssesor;
6 5 use FluentForm\Framework\Helpers\ArrayHelper as Arr;
7 6
8 7 class Validations
9 8 {
@@ -55,8 +54,21 @@
55 54 */
56 55 protected $messages = [];
57 56
58 57 /**
58 + * Rules the validator has no method for.
59 + *
60 + * Selection limits are counted against the field's own options in
61 + * Helper::validateSelectionLimits(), which runs later in the submission with
62 + * the raw field settings in hand — the only place the configured (or global)
63 + * message for the breach can be resolved. Emitting them here too would lean
64 + * on the validator silently ignoring rules it does not recognise.
65 + *
66 + * @var array
67 + */
68 + protected $rulesHandledElsewhere = ['min_selection', 'max_selection'];
69 +
70 + /**
59 71 * The validation extractor constructor.
60 72 *
61 73 * @param array $formFields
62 74 * @param array $formData
@@ -86,8 +98,12 @@
86 98 // If the field is a repeater we'll set some settings here.
87 99 $this->setRepeater($fieldName, $field);
88 100
89 101 foreach ($rules as $ruleName => $rule) {
102 + if (in_array($ruleName, $this->rulesHandledElsewhere, true)) {
103 + continue;
104 + }
105 +
90 106 if ($this->shouldNotSkipThisRule($rule, $fieldValue, $hasRequiredRule)) {
91 107 $this->prepareValidations($fieldName, $ruleName, $rule);
92 108 }
93 109 }