Version Description
- New: The step value for number fields is now validated server side on submission.
Download this release
Release Info
Developer | formidableforms |
Plugin | Formidable Forms – Form Builder for WordPress |
Version | 5.2.06 |
Comparing to | |
See all releases |
Code changes from version 5.2.05 to 5.2.06
- classes/helpers/FrmAppHelper.php +1 -1
- classes/models/fields/FrmFieldNumber.php +36 -0
- formidable.php +1 -1
- languages/formidable.pot +7 -2
- readme.txt +4 -7
classes/helpers/FrmAppHelper.php
CHANGED
@@ -11,7 +11,7 @@ class FrmAppHelper {
|
|
11 |
/**
|
12 |
* @since 2.0
|
13 |
*/
|
14 |
-
public static $plug_version = '5.2.
|
15 |
|
16 |
/**
|
17 |
* @since 1.07.02
|
11 |
/**
|
12 |
* @since 2.0
|
13 |
*/
|
14 |
+
public static $plug_version = '5.2.06';
|
15 |
|
16 |
/**
|
17 |
* @since 1.07.02
|
classes/models/fields/FrmFieldNumber.php
CHANGED
@@ -70,11 +70,47 @@ class FrmFieldNumber extends FrmFieldType {
|
|
70 |
$errors[ 'field' . $args['id'] ] = __( 'Please select a lower number', 'formidable' );
|
71 |
}
|
72 |
}
|
|
|
|
|
73 |
}
|
74 |
|
75 |
return $errors;
|
76 |
}
|
77 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
/**
|
79 |
* IE fallback for number fields
|
80 |
* Remove the comma when HTML5 isn't supported
|
70 |
$errors[ 'field' . $args['id'] ] = __( 'Please select a lower number', 'formidable' );
|
71 |
}
|
72 |
}
|
73 |
+
|
74 |
+
$this->validate_step( $errors, $args );
|
75 |
}
|
76 |
|
77 |
return $errors;
|
78 |
}
|
79 |
|
80 |
+
/**
|
81 |
+
* Validates the step setting.
|
82 |
+
*
|
83 |
+
* @since 5.2.06
|
84 |
+
*
|
85 |
+
* @param array $errors Errors array.
|
86 |
+
* @param array $args Validation args.
|
87 |
+
*/
|
88 |
+
private function validate_step( &$errors, $args ) {
|
89 |
+
if ( isset( $errors[ 'field' . $args['id'] ] ) ) {
|
90 |
+
return; // Don't need to check if value is invalid before.
|
91 |
+
}
|
92 |
+
|
93 |
+
$step = FrmField::get_option( $this->field, 'step' );
|
94 |
+
if ( ! $step || ! is_numeric( $step ) ) {
|
95 |
+
return;
|
96 |
+
}
|
97 |
+
|
98 |
+
$value = (float) $args['value'];
|
99 |
+
$step = (float) $step;
|
100 |
+
$div = $value / $step;
|
101 |
+
if ( floor( $div ) === $div ) {
|
102 |
+
return;
|
103 |
+
}
|
104 |
+
|
105 |
+
$div = floor( $div );
|
106 |
+
$errors[ 'field' . $args['id'] ] = sprintf(
|
107 |
+
// Translators: %1$s: the first nearest value; %2$s: the second nearest value.
|
108 |
+
__( 'Please enter a valid value. Two nearest valid values are %1$s and %2$s', 'formidable' ),
|
109 |
+
floatval( $div * $step ),
|
110 |
+
floatval( ( $div + 1 ) * $step )
|
111 |
+
);
|
112 |
+
}
|
113 |
+
|
114 |
/**
|
115 |
* IE fallback for number fields
|
116 |
* Remove the comma when HTML5 isn't supported
|
formidable.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/*
|
3 |
Plugin Name: Formidable Forms
|
4 |
Description: Quickly and easily create drag-and-drop forms
|
5 |
-
Version: 5.2.
|
6 |
Plugin URI: https://formidableforms.com/
|
7 |
Author URI: https://formidableforms.com/
|
8 |
Author: Strategy11
|
2 |
/*
|
3 |
Plugin Name: Formidable Forms
|
4 |
Description: Quickly and easily create drag-and-drop forms
|
5 |
+
Version: 5.2.06
|
6 |
Plugin URI: https://formidableforms.com/
|
7 |
Author URI: https://formidableforms.com/
|
8 |
Author: Strategy11
|
languages/formidable.pot
CHANGED
@@ -2,14 +2,14 @@
|
|
2 |
# This file is distributed under the same license as the Formidable Forms plugin.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Formidable Forms 5.2.
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/formidable\n"
|
7 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
8 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
-
"POT-Creation-Date: 2022-
|
13 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
14 |
"X-Generator: WP-CLI 2.4.0\n"
|
15 |
"X-Domain: formidable\n"
|
@@ -3804,6 +3804,11 @@ msgstr ""
|
|
3804 |
msgid "Please select a lower number"
|
3805 |
msgstr ""
|
3806 |
|
|
|
|
|
|
|
|
|
|
|
3807 |
#. translators: %s: Field name
|
3808 |
#. translators: %s: Field type
|
3809 |
#: classes/models/fields/FrmFieldType.php:395
|
2 |
# This file is distributed under the same license as the Formidable Forms plugin.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Formidable Forms 5.2.06\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/formidable\n"
|
7 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
8 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"POT-Creation-Date: 2022-05-04T17:24:07+00:00\n"
|
13 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
14 |
"X-Generator: WP-CLI 2.4.0\n"
|
15 |
"X-Domain: formidable\n"
|
3804 |
msgid "Please select a lower number"
|
3805 |
msgstr ""
|
3806 |
|
3807 |
+
#. Translators: %1$s: the first nearest value; %2$s: the second nearest value.
|
3808 |
+
#: classes/models/fields/FrmFieldNumber.php:108
|
3809 |
+
msgid "Please enter a valid value. Two nearest valid values are %1$s and %2$s"
|
3810 |
+
msgstr ""
|
3811 |
+
|
3812 |
#. translators: %s: Field name
|
3813 |
#. translators: %s: Field type
|
3814 |
#: classes/models/fields/FrmFieldType.php:395
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Tags: forms, contact form, form builder, survey, free, form maker, form creator,
|
|
5 |
Requires at least: 5.2
|
6 |
Tested up to: 5.9.3
|
7 |
Requires PHP: 5.6
|
8 |
-
Stable tag: 5.2.
|
9 |
|
10 |
The most advanced WordPress forms plugin. Go beyond contact forms with our drag & drop form builder for surveys, quizzes, and more.
|
11 |
|
@@ -438,6 +438,9 @@ Using our Zapier integration, you can easily connect Formidable with over 1000+
|
|
438 |
See all <a href="https://zapier.com/apps/formidable/integrations">Formidable Zapier Integrations</a>.
|
439 |
|
440 |
== Changelog ==
|
|
|
|
|
|
|
441 |
= 5.2.05 =
|
442 |
* New: Added a new frm_focus_first_error filter to toggle of the behavior of the auto-focus that gets triggered on the first field with an error.
|
443 |
* New: Added a new frm_include_alert_role_on_field_errors filter to toggle the alert role that gets added to field errors.
|
@@ -446,10 +449,4 @@ See all <a href="https://zapier.com/apps/formidable/integrations">Formidable Zap
|
|
446 |
* New: Defined field option data will no longer be sent to Akismet, to help improve accuracy with Akismet API.
|
447 |
* Fix: Updated Elementor widget so it no longer uses the deprecated _register_controls method.
|
448 |
|
449 |
-
= 5.2.03 =
|
450 |
-
* New: Updated how unique field and form keys are generated for shorter unique keys.
|
451 |
-
* New: Added a new frm_unique_field_key_separator filter for unique field keys.
|
452 |
-
* New: Added a new frm_saved_errors filter for extending custom form validation.
|
453 |
-
* Fix: Fixed a conflict with All in One SEO that was causing multiselect dropdowns to appear larger than expected.
|
454 |
-
|
455 |
<a href="https://raw.githubusercontent.com/Strategy11/formidable-forms/master/changelog.txt">See changelog for all versions</a>
|
5 |
Requires at least: 5.2
|
6 |
Tested up to: 5.9.3
|
7 |
Requires PHP: 5.6
|
8 |
+
Stable tag: 5.2.06
|
9 |
|
10 |
The most advanced WordPress forms plugin. Go beyond contact forms with our drag & drop form builder for surveys, quizzes, and more.
|
11 |
|
438 |
See all <a href="https://zapier.com/apps/formidable/integrations">Formidable Zapier Integrations</a>.
|
439 |
|
440 |
== Changelog ==
|
441 |
+
= 5.2.06 =
|
442 |
+
* New: The step value for number fields is now validated server side on submission.
|
443 |
+
|
444 |
= 5.2.05 =
|
445 |
* New: Added a new frm_focus_first_error filter to toggle of the behavior of the auto-focus that gets triggered on the first field with an error.
|
446 |
* New: Added a new frm_include_alert_role_on_field_errors filter to toggle the alert role that gets added to field errors.
|
449 |
* New: Defined field option data will no longer be sent to Akismet, to help improve accuracy with Akismet API.
|
450 |
* Fix: Updated Elementor widget so it no longer uses the deprecated _register_controls method.
|
451 |
|
|
|
|
|
|
|
|
|
|
|
|
|
452 |
<a href="https://raw.githubusercontent.com/Strategy11/formidable-forms/master/changelog.txt">See changelog for all versions</a>
|