Formidable Forms – Form Builder for WordPress - Version 5.0.16

Version Description

  • New: Field shortcodes now support sanitize_url=1 and sanitize=1 options which were previously only processed in Pro. For more information on how these options work, see https://formidableforms.com/knowledgebase/advanced/#kb-sanitize-url
  • New: The sanitize_url=1 option will now be inserted automatically when inserting most field shortcodes to a redirect url. This is to avoid issues with redirects stripping characters like ' and @ which may cause a redirect to fail in some cases.
  • New: Updated styling for radio buttons and checkboxes, with improvements to appearance on mobile devices as well.
  • New: Extended the FrmCSVExportHelper::generate_csv function so it has the option to generate a CSV file in a temporary directory, and pass along an array of meta information to most CSV filter hooks.
  • New: A new action_id variable has been added to the arguments passed to the frm_notification_attachment filter to make it easier to filter attachments by email action ID.
  • New: Added new frm_entry_formatter_class, frm_prepend_and_or_where, frm_entry_formatter_format, frm_formatted_entry_values_content, and frm_entries_show_args filter hooks.
  • New: Allow more colors in the styler to be transparent including background colors and border colors for active, hovered, and disabled inputs.
  • Fix: Selected radio buttons were appearing incorrectly when using the Twenty Twenty One theme in Chrome or Safari.
  • Fix: Radio buttons and checkboxes were appearing overlapped with labels when using the H-Code theme.
  • Fix: Field pop ups were displaying upgrade messages even for licenses that had access to the add on.
Download this release

Release Info

Developer formidableforms
Plugin Icon 128x128 Formidable Forms – Form Builder for WordPress
Version 5.0.16
Comparing to
See all releases

Code changes from version 5.0.15 to 5.0.16

classes/controllers/FrmAddonsController.php CHANGED
@@ -454,6 +454,11 @@ class FrmAddonsController {
454
  if ( ! empty( $link ) ) {
455
  $link['status'] = $addon['status']['type'];
456
  }
 
 
 
 
 
457
  }
458
 
459
  return $link;
454
  if ( ! empty( $link ) ) {
455
  $link['status'] = $addon['status']['type'];
456
  }
457
+ } elseif ( current_user_can( 'activate_plugins' ) && self::is_installed( 'formidable-' . $plugin . '/formidable-' . $plugin . '.php' ) ) {
458
+ $link = array(
459
+ 'url' => 'formidable-' . $plugin . '/formidable-' . $plugin . '.php',
460
+ 'class' => 'frm-activate-addon',
461
+ );
462
  }
463
 
464
  return $link;
classes/controllers/FrmFormsController.php CHANGED
@@ -1117,6 +1117,12 @@ class FrmFormsController {
1117
  'function' => 'buttons_settings',
1118
  'icon' => 'frm_icon_font frm_pallet_icon',
1119
  ),
 
 
 
 
 
 
1120
  'html' => array(
1121
  'name' => __( 'Customize HTML', 'formidable' ),
1122
  'class' => __CLASS__,
@@ -1125,6 +1131,10 @@ class FrmFormsController {
1125
  ),
1126
  );
1127
 
 
 
 
 
1128
  $sections = apply_filters( 'frm_add_form_settings_section', $sections, $values );
1129
 
1130
  if ( FrmAppHelper::pro_is_installed() && ! FrmAppHelper::meets_min_pro_version( '4.0' ) ) {
@@ -2239,6 +2249,28 @@ class FrmFormsController {
2239
  return isset( $atts['minimize'] ) && ! empty( $atts['minimize'] );
2240
  }
2241
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2242
  /**
2243
  * @deprecated 4.0
2244
  */
1117
  'function' => 'buttons_settings',
1118
  'icon' => 'frm_icon_font frm_pallet_icon',
1119
  ),
1120
+ 'landing' => array(
1121
+ 'name' => __( 'Form Landing Page', 'formidable' ),
1122
+ 'icon' => 'frm_icon_font frm_file_text_icon',
1123
+ 'html_class' => 'frm_show_upgrade frm_noallow',
1124
+ 'data' => FrmAppHelper::get_landing_page_upgrade_data_params(),
1125
+ ),
1126
  'html' => array(
1127
  'name' => __( 'Customize HTML', 'formidable' ),
1128
  'class' => __CLASS__,
1131
  ),
1132
  );
1133
 
1134
+ if ( ! FrmAppHelper::show_landing_pages() ) {
1135
+ unset( $sections['landing'] );
1136
+ }
1137
+
1138
  $sections = apply_filters( 'frm_add_form_settings_section', $sections, $values );
1139
 
1140
  if ( FrmAppHelper::pro_is_installed() && ! FrmAppHelper::meets_min_pro_version( '4.0' ) ) {
2249
  return isset( $atts['minimize'] ) && ! empty( $atts['minimize'] );
2250
  }
2251
 
2252
+ /**
2253
+ * @since 5.0.16
2254
+ *
2255
+ * @return void
2256
+ */
2257
+ public static function landing_page_preview_option() {
2258
+ $dir = apply_filters( 'frm_landing_page_preview_option', false );
2259
+ if ( false === $dir || ! file_exists( $dir . 'landing-page-preview-option.php' ) ) {
2260
+ $dir = self::get_form_views_path();
2261
+ }
2262
+ include $dir . 'landing-page-preview-option.php';
2263
+ }
2264
+
2265
+ /**
2266
+ * @since 5.0.16
2267
+ *
2268
+ * @return string
2269
+ */
2270
+ private static function get_form_views_path() {
2271
+ return FrmAppHelper::plugin_path() . '/classes/views/frm-forms/';
2272
+ }
2273
+
2274
  /**
2275
  * @deprecated 4.0
2276
  */
classes/controllers/FrmXMLController.php CHANGED
@@ -613,13 +613,14 @@ class FrmXMLController {
613
  * Get the fields that should be included in the CSV export
614
  *
615
  * @since 2.0.19
 
616
  *
617
  * @param int $form_id
618
  * @param object $form
619
  *
620
  * @return array $csv_fields
621
  */
622
- private static function get_fields_for_csv_export( $form_id, $form ) {
623
  $csv_fields = FrmField::get_all_for_form( $form_id, '', 'include', 'include' );
624
  $no_export_fields = FrmField::no_save_fields();
625
  foreach ( $csv_fields as $k => $f ) {
613
  * Get the fields that should be included in the CSV export
614
  *
615
  * @since 2.0.19
616
+ * @since 5.0.16 function went from private to public.
617
  *
618
  * @param int $form_id
619
  * @param object $form
620
  *
621
  * @return array $csv_fields
622
  */
623
+ public static function get_fields_for_csv_export( $form_id, $form ) {
624
  $csv_fields = FrmField::get_all_for_form( $form_id, '', 'include', 'include' );
625
  $no_export_fields = FrmField::no_save_fields();
626
  foreach ( $csv_fields as $k => $f ) {
classes/factories/FrmEntryFactory.php CHANGED
@@ -18,13 +18,23 @@ class FrmEntryFactory {
18
  * @return FrmEntryFormatter|FrmProEntryFormatter
19
  */
20
  public static function entry_formatter_instance( $atts ) {
 
 
21
  if ( FrmAppHelper::pro_is_installed() ) {
22
- $entry_formatter = new FrmProEntryFormatter( $atts );
23
- } else {
24
- $entry_formatter = new FrmEntryFormatter( $atts );
25
  }
26
 
27
- return $entry_formatter;
 
 
 
 
 
 
 
 
 
 
28
  }
29
 
30
  /**
18
  * @return FrmEntryFormatter|FrmProEntryFormatter
19
  */
20
  public static function entry_formatter_instance( $atts ) {
21
+ $formatter_class = 'FrmEntryFormatter';
22
+
23
  if ( FrmAppHelper::pro_is_installed() ) {
24
+ $formatter_class = 'FrmProEntryFormatter';
 
 
25
  }
26
 
27
+ /**
28
+ * Allows changing entry formatter class name.
29
+ *
30
+ * @since 5.0.16
31
+ *
32
+ * @param string $formatter_class Entry formatter class name.
33
+ * @param array $atts See {@see FrmEntriesController::show_entry_shortcode()}.
34
+ */
35
+ $formatter_class = apply_filters( 'frm_entry_formatter_class', $formatter_class, $atts );
36
+
37
+ return new $formatter_class( $atts );
38
  }
39
 
40
  /**
classes/helpers/FrmAppHelper.php CHANGED
@@ -11,7 +11,7 @@ class FrmAppHelper {
11
  /**
12
  * @since 2.0
13
  */
14
- public static $plug_version = '5.0.15';
15
 
16
  /**
17
  * @since 1.07.02
@@ -3218,6 +3218,36 @@ class FrmAppHelper {
3218
  return $value;
3219
  }
3220
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3221
  /**
3222
  * @since 4.07
3223
  * @deprecated 4.09.01
11
  /**
12
  * @since 2.0
13
  */
14
+ public static $plug_version = '5.0.16';
15
 
16
  /**
17
  * @since 1.07.02
3218
  return $value;
3219
  }
3220
 
3221
+ /**
3222
+ * @since 5.0.16
3223
+ *
3224
+ * @return bool
3225
+ */
3226
+ public static function show_landing_pages() {
3227
+ $link = FrmAddonsController::install_link( 'landing' );
3228
+ return array_key_exists( 'class', $link );
3229
+ }
3230
+
3231
+ /**
3232
+ * @since 5.0.16
3233
+ *
3234
+ * @return array
3235
+ */
3236
+ public static function get_landing_page_upgrade_data_params() {
3237
+ $link = self::pro_is_installed() ? FrmAddonsController::install_link( 'landing' ) : array();
3238
+ $params = array(
3239
+ 'medium' => 'landing-preview',
3240
+ 'upgrade' => __( 'Form Landing Pages', 'formidable' ),
3241
+ );
3242
+ if ( $link && ! empty( $link['url'] ) ) {
3243
+ $params['oneclick'] = json_encode( $link );
3244
+ } else {
3245
+ $params['requires'] = 'Plus';
3246
+ $params['message'] = __( 'Easily manage a landing page for your form. Upgrade to get form landing pages.', 'formidable' );
3247
+ }
3248
+ return $params;
3249
+ }
3250
+
3251
  /**
3252
  * @since 4.07
3253
  * @deprecated 4.09.01
classes/helpers/FrmCSVExportHelper.php CHANGED
@@ -5,20 +5,91 @@ if ( ! defined( 'ABSPATH' ) ) {
5
 
6
  class FrmCSVExportHelper {
7
 
8
- protected static $separator = ', ';
 
 
 
 
 
 
 
9
  protected static $column_separator = ',';
10
- protected static $line_break = 'return';
11
- protected static $charset = 'UTF-8';
12
- protected static $to_encoding = 'UTF-8';
13
- protected static $wp_date_format = 'Y-m-d H:i:s';
14
- protected static $comment_count = 0;
15
- protected static $form_id = 0;
16
- protected static $headings = array();
17
- protected static $fields = array();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  protected static $entry;
 
 
 
 
19
  protected static $has_parent_id;
 
 
 
 
20
  protected static $fields_by_repeater_id;
21
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  public static function csv_format_options() {
23
  $formats = array( 'UTF-8', 'ISO-8859-1', 'windows-1256', 'windows-1251', 'macintosh' );
24
  $formats = apply_filters( 'frm_csv_format_options', $formats );
@@ -26,19 +97,36 @@ class FrmCSVExportHelper {
26
  return $formats;
27
  }
28
 
 
 
 
 
29
  public static function generate_csv( $atts ) {
30
  global $frm_vars;
31
  $frm_vars['prevent_caching'] = true;
32
 
33
  self::$fields = $atts['form_cols'];
34
  self::$form_id = $atts['form']->id;
35
- self::set_class_paramters();
 
 
 
 
36
  self::set_has_parent_id( $atts['form'] );
37
 
38
- $filename = apply_filters( 'frm_csv_filename', gmdate( 'ymdHis', time() ) . '_' . sanitize_title_with_dashes( $atts['form']->name ) . '_formidable_entries.csv', $atts['form'] );
39
  unset( $atts['form'], $atts['form_cols'] );
40
 
41
- self::print_file_headers( $filename );
 
 
 
 
 
 
 
 
 
42
  unset( $filename );
43
 
44
  $comment_count = FrmDb::get_count(
@@ -62,18 +150,47 @@ class FrmCSVExportHelper {
62
  while ( $next_set = array_splice( $atts['entry_ids'], 0, 20 ) ) {
63
  self::prepare_next_csv_rows( $next_set );
64
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
  }
66
 
67
- private static function set_class_paramters() {
68
- self::$separator = apply_filters( 'frm_csv_sep', self::$separator );
69
- self::$line_break = apply_filters( 'frm_csv_line_break', self::$line_break );
70
- self::$wp_date_format = apply_filters( 'frm_csv_date_format', self::$wp_date_format );
 
 
 
 
 
 
 
 
 
 
 
 
 
71
  self::get_csv_format();
72
  self::$charset = get_option( 'blog_charset' );
73
 
74
- $col_sep = ( isset( $_POST['csv_col_sep'] ) && ! empty( $_POST['csv_col_sep'] ) ) ? sanitize_text_field( wp_unslash( $_POST['csv_col_sep'] ) ) : self::$column_separator; // phpcs:ignore WordPress.Security.NonceVerification.Missing
75
 
76
- self::$column_separator = apply_filters( 'frm_csv_column_sep', $col_sep );
77
  }
78
 
79
  private static function set_has_parent_id( $form ) {
@@ -100,7 +217,7 @@ class FrmCSVExportHelper {
100
 
101
  public static function get_csv_format() {
102
  $csv_format = FrmAppHelper::get_post_param( 'csv_format', 'UTF-8', 'sanitize_text_field' );
103
- $csv_format = apply_filters( 'frm_csv_format', $csv_format );
104
  self::$to_encoding = $csv_format;
105
  }
106
 
@@ -111,8 +228,9 @@ class FrmCSVExportHelper {
111
  'frm_csv_columns',
112
  $headings,
113
  self::$form_id,
114
- array(
115
- 'fields' => self::$fields,
 
116
  )
117
  );
118
  self::$headings = $headings;
@@ -136,8 +254,9 @@ class FrmCSVExportHelper {
136
  $field_headings = apply_filters(
137
  'frm_csv_field_columns',
138
  $field_headings,
139
- array(
140
- 'field' => $col,
 
141
  )
142
  );
143
 
@@ -290,6 +409,7 @@ class FrmCSVExportHelper {
290
  'entry' => self::$entry,
291
  'date_format' => self::$wp_date_format,
292
  'comment_count' => self::$comment_count,
 
293
  )
294
  );
295
  self::print_csv_row( $row );
@@ -389,6 +509,7 @@ class FrmCSVExportHelper {
389
  'field' => $col,
390
  'entry' => self::$entry,
391
  'separator' => self::$separator,
 
392
  )
393
  );
394
 
@@ -474,7 +595,8 @@ class FrmCSVExportHelper {
474
  }
475
 
476
  private static function print_csv_row( $rows ) {
477
- $sep = '';
 
478
 
479
  foreach ( self::$headings as $k => $heading ) {
480
  if ( isset( $rows[ $k ] ) ) {
@@ -505,12 +627,20 @@ class FrmCSVExportHelper {
505
  $val = str_replace( array( "\r\n", "\r", "\n" ), self::$line_break, $val );
506
  }
507
 
508
- echo $sep . '"' . $val . '"'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
 
 
 
 
509
  $sep = self::$column_separator;
510
 
511
  unset( $k, $row );
512
  }
513
- echo "\n";
 
 
 
 
514
  }
515
 
516
  public static function encode_value( $line ) {
5
 
6
  class FrmCSVExportHelper {
7
 
8
+ /**
9
+ * @var string $separator
10
+ */
11
+ protected static $separator = ', ';
12
+
13
+ /**
14
+ * @var string $column_separator
15
+ */
16
  protected static $column_separator = ',';
17
+
18
+ /**
19
+ * @var string $line_break
20
+ */
21
+ protected static $line_break = 'return';
22
+
23
+ /**
24
+ * @var string $charset
25
+ */
26
+ protected static $charset = 'UTF-8';
27
+
28
+ /**
29
+ * @var string $to_encoding
30
+ */
31
+ protected static $to_encoding = 'UTF-8';
32
+
33
+ /**
34
+ * @var string $wp_date_format
35
+ */
36
+ protected static $wp_date_format = 'Y-m-d H:i:s';
37
+
38
+ /**
39
+ * @var int $comment_count
40
+ */
41
+ protected static $comment_count = 0;
42
+
43
+ /**
44
+ * @var int $form_id
45
+ */
46
+ protected static $form_id = 0;
47
+
48
+ /**
49
+ * @var array $headings
50
+ */
51
+ protected static $headings = array();
52
+
53
+ /**
54
+ * @var array $fields
55
+ */
56
+ protected static $fields = array();
57
+
58
+ /**
59
+ * @var stdClass|null $entry
60
+ */
61
  protected static $entry;
62
+
63
+ /**
64
+ * @var bool|null $has_parent_id
65
+ */
66
  protected static $has_parent_id;
67
+
68
+ /**
69
+ * @var array|null $fields_by_repeater_id
70
+ */
71
  protected static $fields_by_repeater_id;
72
 
73
+ /**
74
+ * @var string $mode either 'echo' or 'file' are supported.
75
+ */
76
+ protected static $mode = 'echo';
77
+
78
+ /**
79
+ * @var resource|null $fp used to write a CSV file in file mode.
80
+ */
81
+ protected static $fp;
82
+
83
+ /**
84
+ * @var string $context the context of the CSV being generated. Possible values include 'email' when used as an email attachment, or 'default'.
85
+ */
86
+ protected static $context = 'default';
87
+
88
+ /**
89
+ * @var array $meta
90
+ */
91
+ protected static $meta = array();
92
+
93
  public static function csv_format_options() {
94
  $formats = array( 'UTF-8', 'ISO-8859-1', 'windows-1256', 'windows-1251', 'macintosh' );
95
  $formats = apply_filters( 'frm_csv_format_options', $formats );
97
  return $formats;
98
  }
99
 
100
+ /**
101
+ * @param array $atts
102
+ * @return string|false|void returns a string file path or false if $atts['mode'] is set to 'file'.
103
+ */
104
  public static function generate_csv( $atts ) {
105
  global $frm_vars;
106
  $frm_vars['prevent_caching'] = true;
107
 
108
  self::$fields = $atts['form_cols'];
109
  self::$form_id = $atts['form']->id;
110
+ self::$mode = ! empty( $atts['mode'] ) && 'file' === $atts['mode'] ? 'file' : 'echo';
111
+ self::$context = ! empty( $atts['context'] ) ? $atts['context'] : 'default';
112
+ self::$meta = ! empty( $atts['meta'] ) ? $atts['meta'] : array();
113
+
114
+ self::set_class_parameters();
115
  self::set_has_parent_id( $atts['form'] );
116
 
117
+ $filename = self::generate_csv_filename( $atts['form'] );
118
  unset( $atts['form'], $atts['form_cols'] );
119
 
120
+ if ( 'file' === self::$mode ) {
121
+ $filepath = get_temp_dir() . $filename;
122
+ self::$fp = @fopen( $filepath, 'w' );
123
+ if ( ! self::$fp ) {
124
+ return false;
125
+ }
126
+ } elseif ( 'echo' === self::$mode ) {
127
+ self::print_file_headers( $filename );
128
+ }
129
+
130
  unset( $filename );
131
 
132
  $comment_count = FrmDb::get_count(
150
  while ( $next_set = array_splice( $atts['entry_ids'], 0, 20 ) ) {
151
  self::prepare_next_csv_rows( $next_set );
152
  }
153
+
154
+ if ( 'file' === self::$mode ) {
155
+ fclose( self::$fp );
156
+ return $filepath;
157
+ }
158
+ }
159
+
160
+ /**
161
+ * @since 5.0.16
162
+ *
163
+ * @param stdClass $form
164
+ * @return string
165
+ */
166
+ private static function generate_csv_filename( $form ) {
167
+ $filename = gmdate( 'ymdHis', time() ) . '_' . sanitize_title_with_dashes( $form->name ) . '_formidable_entries.csv';
168
+ return apply_filters( 'frm_csv_filename', $filename, $form, self::get_standard_filter_args() );
169
  }
170
 
171
+ /**
172
+ * @since 5.0.16
173
+ *
174
+ * @return array
175
+ */
176
+ private static function get_standard_filter_args() {
177
+ return array(
178
+ 'context' => self::$context,
179
+ 'meta' => self::$meta,
180
+ );
181
+ }
182
+
183
+ private static function set_class_parameters() {
184
+ $args = self::get_standard_filter_args();
185
+ self::$separator = apply_filters( 'frm_csv_sep', self::$separator, $args );
186
+ self::$line_break = apply_filters( 'frm_csv_line_break', self::$line_break, $args );
187
+ self::$wp_date_format = apply_filters( 'frm_csv_date_format', self::$wp_date_format, $args );
188
  self::get_csv_format();
189
  self::$charset = get_option( 'blog_charset' );
190
 
191
+ $col_sep = ! empty( $_POST['csv_col_sep'] ) ? sanitize_text_field( wp_unslash( $_POST['csv_col_sep'] ) ) : self::$column_separator; // phpcs:ignore WordPress.Security.NonceVerification.Missing
192
 
193
+ self::$column_separator = apply_filters( 'frm_csv_column_sep', $col_sep, $args );
194
  }
195
 
196
  private static function set_has_parent_id( $form ) {
217
 
218
  public static function get_csv_format() {
219
  $csv_format = FrmAppHelper::get_post_param( 'csv_format', 'UTF-8', 'sanitize_text_field' );
220
+ $csv_format = apply_filters( 'frm_csv_format', $csv_format, self::get_standard_filter_args() );
221
  self::$to_encoding = $csv_format;
222
  }
223
 
228
  'frm_csv_columns',
229
  $headings,
230
  self::$form_id,
231
+ array_merge(
232
+ self::get_standard_filter_args(),
233
+ array( 'fields' => self::$fields )
234
  )
235
  );
236
  self::$headings = $headings;
254
  $field_headings = apply_filters(
255
  'frm_csv_field_columns',
256
  $field_headings,
257
+ array_merge(
258
+ self::get_standard_filter_args(),
259
+ array( 'field' => $col )
260
  )
261
  );
262
 
409
  'entry' => self::$entry,
410
  'date_format' => self::$wp_date_format,
411
  'comment_count' => self::$comment_count,
412
+ 'context' => self::$context,
413
  )
414
  );
415
  self::print_csv_row( $row );
509
  'field' => $col,
510
  'entry' => self::$entry,
511
  'separator' => self::$separator,
512
+ 'context' => self::$context,
513
  )
514
  );
515
 
595
  }
596
 
597
  private static function print_csv_row( $rows ) {
598
+ $sep = '';
599
+ $echo = 'echo' === self::$mode;
600
 
601
  foreach ( self::$headings as $k => $heading ) {
602
  if ( isset( $rows[ $k ] ) ) {
627
  $val = str_replace( array( "\r\n", "\r", "\n" ), self::$line_break, $val );
628
  }
629
 
630
+ if ( $echo ) {
631
+ echo $sep . '"' . $val . '"'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
632
+ } else {
633
+ fwrite( self::$fp, $sep . '"' . $val . '"' );
634
+ }
635
  $sep = self::$column_separator;
636
 
637
  unset( $k, $row );
638
  }
639
+ if ( $echo ) {
640
+ echo "\n";
641
+ } else {
642
+ fwrite( self::$fp, "\n" );
643
+ }
644
  }
645
 
646
  public static function encode_value( $line ) {
classes/helpers/FrmFieldsHelper.php CHANGED
@@ -746,6 +746,7 @@ class FrmFieldsHelper {
746
  $replace_with = self::get_value_for_shortcode( $atts );
747
 
748
  if ( $replace_with !== null ) {
 
749
  self::sanitize_embedded_shortcodes( compact( 'entry' ), $replace_with );
750
  $content = str_replace( $shortcodes[0][ $short_key ], $replace_with, $content );
751
  }
@@ -756,6 +757,36 @@ class FrmFieldsHelper {
756
  return $content;
757
  }
758
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
759
  /**
760
  * Prevent shortcodes in fields from being processed
761
  *
@@ -1852,8 +1883,22 @@ class FrmFieldsHelper {
1852
  }
1853
  }
1854
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1855
  ?>
1856
- <li class="frmbutton frm6 <?php echo esc_attr( $args['no_allow_class'] . $single_no_allow . ' frm_t' . str_replace( '|', '-', $field_key ) ); ?>" id="<?php echo esc_attr( $field_key ); ?>" data-upgrade="<?php echo esc_attr( $upgrade_label ); ?>" data-message="<?php echo esc_attr( $upgrade_message ); ?>" data-link="<?php echo esc_attr( $link ); ?>" data-medium="builder" data-oneclick="<?php echo esc_attr( $install_data ); ?>" data-content="<?php echo esc_attr( $field_key ); ?>" data-requires="<?php echo esc_attr( $requires ); ?>">
1857
  <?php
1858
  if ( $run_filter ) {
1859
  $field_label = apply_filters( 'frmpro_field_links', $field_label, $args['id'], $field_key );
746
  $replace_with = self::get_value_for_shortcode( $atts );
747
 
748
  if ( $replace_with !== null ) {
749
+ $replace_with = self::trigger_shortcode_atts( $replace_with, $atts );
750
  self::sanitize_embedded_shortcodes( compact( 'entry' ), $replace_with );
751
  $content = str_replace( $shortcodes[0][ $short_key ], $replace_with, $content );
752
  }
757
  return $content;
758
  }
759
 
760
+ /**
761
+ * @param string $replace_with
762
+ * @param array $atts
763
+ */
764
+ private static function trigger_shortcode_atts( $replace_with, $atts ) {
765
+ $supported_atts = array( 'sanitize', 'sanitize_url' );
766
+ $included_atts = array_intersect( $supported_atts, array_keys( $atts ) );
767
+ foreach ( $included_atts as $included_att ) {
768
+ $function = 'atts_' . $included_att;
769
+ $replace_with = self::$function( $replace_with, $atts );
770
+ }
771
+ return $replace_with;
772
+ }
773
+
774
+ /**
775
+ * @param string $replace_with
776
+ * @return string
777
+ */
778
+ private static function atts_sanitize( $replace_with ) {
779
+ return sanitize_title_with_dashes( $replace_with );
780
+ }
781
+
782
+ /**
783
+ * @param string $replace_with
784
+ * @return string
785
+ */
786
+ private static function atts_sanitize_url( $replace_with ) {
787
+ return urlencode( $replace_with );
788
+ }
789
+
790
  /**
791
  * Prevent shortcodes in fields from being processed
792
  *
1883
  }
1884
  }
1885
 
1886
+ $li_params = array(
1887
+ 'class' => 'frmbutton frm6 ' . $args['no_allow_class'] . $single_no_allow . ' frm_t' . str_replace( '|', '-', $field_key ),
1888
+ 'id' => $field_key,
1889
+ 'data-upgrade' => $upgrade_label,
1890
+ 'data-link' => $link,
1891
+ 'data-medium' => 'builder',
1892
+ 'data-oneclick' => $install_data,
1893
+ 'data-content' => $field_key,
1894
+ 'data-requires' => $requires,
1895
+ );
1896
+
1897
+ if ( $upgrade_message ) {
1898
+ $li_params['data-message'] = $upgrade_message;
1899
+ }
1900
  ?>
1901
+ <li <?php FrmAppHelper::array_to_html_params( $li_params, true ); ?>>
1902
  <?php
1903
  if ( $run_filter ) {
1904
  $field_label = apply_filters( 'frmpro_field_links', $field_label, $args['id'], $field_key );
classes/helpers/FrmFormsHelper.php CHANGED
@@ -561,6 +561,10 @@ BEFORE_HTML;
561
  if ( $possible_email_field ) {
562
  $class .= ' show_frm_not_email_to';
563
  }
 
 
 
 
564
  ?>
565
  <li class="<?php echo esc_attr( $class ); ?>">
566
  <a href="javascript:void(0)" class="frmids frm_insert_code"
@@ -1610,4 +1614,64 @@ BEFORE_HTML;
1610
  0
1611
  );
1612
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1613
  }
561
  if ( $possible_email_field ) {
562
  $class .= ' show_frm_not_email_to';
563
  }
564
+
565
+ if ( 'url' === $args['type'] ) {
566
+ $class .= ' frm_insert_url';
567
+ }
568
  ?>
569
  <li class="<?php echo esc_attr( $class ); ?>">
570
  <a href="javascript:void(0)" class="frmids frm_insert_code"
1614
  0
1615
  );
1616
  }
1617
+
1618
+ /**
1619
+ * Make sure the field shortcodes in a url always add the sanitize_url=1 option if nothing is defined.
1620
+ * This is to prevent some field characters like ', @, and | from being stripped from the redirect URL.
1621
+ *
1622
+ * @since 5.0.16
1623
+ *
1624
+ * @param string $url
1625
+ * @param int $form_id
1626
+ * @return string
1627
+ */
1628
+ public static function maybe_add_sanitize_url_attr( $url, $form_id ) {
1629
+ if ( false === strpos( $url, '[' ) ) {
1630
+ // Do nothing if no shortcodes are detected.
1631
+ return $url;
1632
+ }
1633
+
1634
+ $parsed = wp_parse_url( $url );
1635
+ if ( empty( $parsed['query'] ) ) {
1636
+ // Do nothing if no query can be detected in the url string.
1637
+ return $url;
1638
+ }
1639
+
1640
+ $original_query = $parsed['query'];
1641
+ $query = $parsed['query'];
1642
+
1643
+ $shortcodes = FrmFieldsHelper::get_shortcodes( $query, $form_id );
1644
+ if ( empty( $shortcodes[0] ) ) {
1645
+ // No shortcodes found, do nothing.
1646
+ return $url;
1647
+ }
1648
+
1649
+ foreach ( $shortcodes[0] as $key => $shortcode ) {
1650
+ $options = trim( $shortcodes[3][ $key ] );
1651
+
1652
+ if ( in_array( $shortcodes[1][ $key ], array( 'if ' ), true ) ) {
1653
+ // Skip if shortcodes.
1654
+ continue;
1655
+ }
1656
+
1657
+ if ( false !== strpos( $options, 'sanitize_url=' ) || false !== strpos( $options, 'sanitize=' ) ) {
1658
+ // A sanitize option is already set so leave it alone.
1659
+ continue;
1660
+ }
1661
+
1662
+ $new_shortcode = '[' . $shortcodes[2][ $key ];
1663
+ if ( $options ) {
1664
+ $new_shortcode .= ' ' . $options;
1665
+ }
1666
+ $new_shortcode .= ' sanitize_url=1]';
1667
+
1668
+ $query = str_replace( $shortcode, $new_shortcode, $query );
1669
+ }
1670
+
1671
+ if ( $query === $original_query ) {
1672
+ return $url;
1673
+ }
1674
+
1675
+ return str_replace( $original_query, $query, $url );
1676
+ }
1677
  }
classes/helpers/FrmStylesHelper.php CHANGED
@@ -425,11 +425,19 @@ class FrmStylesHelper {
425
  'fieldset_color',
426
  'fieldset_bg_color',
427
  'bg_color',
 
 
428
  'section_bg_color',
429
  'error_bg',
430
  'success_bg_color',
431
  'progress_bg_color',
432
  'progress_active_bg_color',
 
 
 
 
 
 
433
  );
434
 
435
  return array(
425
  'fieldset_color',
426
  'fieldset_bg_color',
427
  'bg_color',
428
+ 'bg_color_active',
429
+ 'bg_color_disabled',
430
  'section_bg_color',
431
  'error_bg',
432
  'success_bg_color',
433
  'progress_bg_color',
434
  'progress_active_bg_color',
435
+ 'submit_border_color',
436
+ 'submit_hover_border_color',
437
+ 'submit_active_border_color',
438
+ 'submit_hover_bg_color',
439
+ 'submit_active_bg_color',
440
+ 'success_bg_color',
441
  );
442
 
443
  return array(
classes/models/FrmDb.php CHANGED
@@ -571,18 +571,26 @@ class FrmDb {
571
  */
572
  public static function prepend_and_or_where( $starts_with = ' WHERE ', $where = '' ) {
573
  if ( empty( $where ) ) {
574
- return '';
575
- }
576
-
577
- if ( is_array( $where ) ) {
578
- global $wpdb;
579
- self::get_where_clause_and_values( $where, $starts_with );
580
- $where = $wpdb->prepare( $where['where'], $where['values'] ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
581
  } else {
582
- $where = $starts_with . $where;
 
 
 
 
 
 
583
  }
584
 
585
- return $where;
 
 
 
 
 
 
 
 
586
  }
587
 
588
  /**
571
  */
572
  public static function prepend_and_or_where( $starts_with = ' WHERE ', $where = '' ) {
573
  if ( empty( $where ) ) {
574
+ $where = '';
 
 
 
 
 
 
575
  } else {
576
+ if ( is_array( $where ) ) {
577
+ global $wpdb;
578
+ self::get_where_clause_and_values( $where, $starts_with );
579
+ $where = $wpdb->prepare( $where['where'], $where['values'] ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
580
+ } else {
581
+ $where = $starts_with . $where;
582
+ }
583
  }
584
 
585
+ /**
586
+ * Allows modifying where clause when using FrmDb::prepend_and_or_where() method.
587
+ *
588
+ * @since 5.0.16
589
+ *
590
+ * @param string $where Where string.
591
+ * @param string $starts_with The start of where string.
592
+ */
593
+ return apply_filters( 'frm_prepend_and_or_where', $where, $starts_with );
594
  }
595
 
596
  /**
classes/models/FrmEmail.php CHANGED
@@ -8,27 +8,96 @@ if ( ! defined( 'ABSPATH' ) ) {
8
  */
9
  class FrmEmail {
10
 
 
 
 
11
  private $email_key = '';
 
 
 
 
12
  private $to = array();
 
 
 
 
13
  private $cc = array();
 
 
 
 
14
  private $bcc = array();
 
 
 
 
15
  private $from = '';
 
 
 
 
16
  private $reply_to = '';
 
 
 
 
17
  private $subject = '';
 
 
 
 
18
  private $message = '';
 
 
 
 
19
  private $attachments = array();
20
 
 
 
 
21
  private $is_plain_text = false;
 
 
 
 
22
  private $is_single_recipient = false;
 
 
 
 
23
  private $include_user_info = false;
24
 
 
 
 
25
  private $charset = '';
 
 
 
 
26
  private $content_type = 'text/html';
27
 
 
 
 
28
  private $settings = array();
 
 
 
 
29
  private $entry;
 
 
 
 
30
  private $form;
31
 
 
 
 
 
 
32
  /**
33
  * FrmEmail constructor
34
  *
@@ -38,9 +107,10 @@ class FrmEmail {
38
  */
39
  public function __construct( $action, $entry, $form ) {
40
  $this->set_email_key( $action );
41
- $this->entry = $entry;
42
- $this->form = $form;
43
- $this->settings = $action->post_content;
 
44
 
45
  $user_id_args = self::get_user_id_args( $form->id );
46
  $this->set_to( $user_id_args );
@@ -332,12 +402,16 @@ class FrmEmail {
332
  * Set the attachments for an email message
333
  *
334
  * @since 2.03.04
 
 
 
335
  */
336
  private function set_attachments() {
337
  $args = array(
338
  'entry' => $this->entry,
339
  'email_key' => $this->email_key,
340
  'settings' => $this->settings,
 
341
  );
342
 
343
  $this->attachments = apply_filters( 'frm_notification_attachment', array(), $this->form, $args );
8
  */
9
  class FrmEmail {
10
 
11
+ /**
12
+ * @var string $email_key
13
+ */
14
  private $email_key = '';
15
+
16
+ /**
17
+ * @var array $to
18
+ */
19
  private $to = array();
20
+
21
+ /**
22
+ * @var array $cc
23
+ */
24
  private $cc = array();
25
+
26
+ /**
27
+ * @var array $bcc
28
+ */
29
  private $bcc = array();
30
+
31
+ /**
32
+ * @var string $from
33
+ */
34
  private $from = '';
35
+
36
+ /**
37
+ * @var string $reply_to
38
+ */
39
  private $reply_to = '';
40
+
41
+ /**
42
+ * @var string $subject
43
+ */
44
  private $subject = '';
45
+
46
+ /**
47
+ * @var string $message
48
+ */
49
  private $message = '';
50
+
51
+ /**
52
+ * @var array $attachments
53
+ */
54
  private $attachments = array();
55
 
56
+ /**
57
+ * @var bool $is_plain_text
58
+ */
59
  private $is_plain_text = false;
60
+
61
+ /**
62
+ * @var bool $is_single_recipient
63
+ */
64
  private $is_single_recipient = false;
65
+
66
+ /**
67
+ * @var bool $include_user_info
68
+ */
69
  private $include_user_info = false;
70
 
71
+ /**
72
+ * @var string $charset
73
+ */
74
  private $charset = '';
75
+
76
+ /**
77
+ * @var string $content_type
78
+ */
79
  private $content_type = 'text/html';
80
 
81
+ /**
82
+ * @var array $settings
83
+ */
84
  private $settings = array();
85
+
86
+ /**
87
+ * @var stdClass $entry
88
+ */
89
  private $entry;
90
+
91
+ /**
92
+ * @var stdClass $form
93
+ */
94
  private $form;
95
 
96
+ /**
97
+ * @var int $action_id
98
+ */
99
+ private $action_id = 0;
100
+
101
  /**
102
  * FrmEmail constructor
103
  *
107
  */
108
  public function __construct( $action, $entry, $form ) {
109
  $this->set_email_key( $action );
110
+ $this->entry = $entry;
111
+ $this->form = $form;
112
+ $this->settings = $action->post_content;
113
+ $this->action_id = (int) $action->ID;
114
 
115
  $user_id_args = self::get_user_id_args( $form->id );
116
  $this->set_to( $user_id_args );
402
  * Set the attachments for an email message
403
  *
404
  * @since 2.03.04
405
+ * @since 5.0.16 added new action_id key to $args.
406
+ *
407
+ * @return void
408
  */
409
  private function set_attachments() {
410
  $args = array(
411
  'entry' => $this->entry,
412
  'email_key' => $this->email_key,
413
  'settings' => $this->settings,
414
+ 'action_id' => $this->action_id,
415
  );
416
 
417
  $this->attachments = apply_filters( 'frm_notification_attachment', array(), $this->form, $args );
classes/models/FrmEntryFormatter.php CHANGED
@@ -196,6 +196,23 @@ class FrmEntryFormatter {
196
  $this->format = 'table';
197
  }
198
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
199
  }
200
 
201
  /**
@@ -383,7 +400,24 @@ class FrmEntryFormatter {
383
  $content = '';
384
  }
385
 
386
- return $content;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
387
  }
388
 
389
  /**
196
  $this->format = 'table';
197
  }
198
  }
199
+
200
+ /**
201
+ * Allows modifying the format property of FrmEntryFormatter object.
202
+ *
203
+ * @since 5.0.16
204
+ *
205
+ * @param string $format The format.
206
+ * @param array $args Includes `atts`, `entry`.
207
+ */
208
+ $this->format = apply_filters(
209
+ 'frm_entry_formatter_format',
210
+ $this->format,
211
+ array(
212
+ 'atts' => $atts,
213
+ 'entry' => $this->entry,
214
+ )
215
+ );
216
  }
217
 
218
  /**
400
  $content = '';
401
  }
402
 
403
+ /**
404
+ * Allows modifying the formatted entry values content.
405
+ *
406
+ * @since 5.0.16
407
+ *
408
+ * @param string $content The formatted entry values content.
409
+ * @param array $args Includes `entry`, `atts`, `format`, `entry_values`.
410
+ */
411
+ return apply_filters(
412
+ 'frm_formatted_entry_values_content',
413
+ $content,
414
+ array(
415
+ 'entry' => $this->entry,
416
+ 'atts' => $this->atts,
417
+ 'format' => $this->format,
418
+ 'entry_values' => $this->entry_values,
419
+ )
420
+ );
421
  }
422
 
423
  /**
classes/models/FrmEntryValues.php CHANGED
@@ -81,6 +81,16 @@ class FrmEntryValues {
81
  $this->entry = FrmEntry::getOne( $entry_id, true );
82
  }
83
 
 
 
 
 
 
 
 
 
 
 
84
  /**
85
  * Set the form_id property
86
  *
81
  $this->entry = FrmEntry::getOne( $entry_id, true );
82
  }
83
 
84
+ /**
85
+ * Gets entry property.
86
+ *
87
+ * @since 5.0.16
88
+ * @return stdClass
89
+ */
90
+ public function get_entry() {
91
+ return $this->entry;
92
+ }
93
+
94
  /**
95
  * Set the form_id property
96
  *
classes/models/FrmFieldValue.php CHANGED
@@ -61,6 +61,16 @@ class FrmFieldValue {
61
  $this->init_saved_value( $entry );
62
  }
63
 
 
 
 
 
 
 
 
 
 
 
64
  /**
65
  * Initialize the saved_value property
66
  *
61
  $this->init_saved_value( $entry );
62
  }
63
 
64
+ /**
65
+ * Gets entry property.
66
+ *
67
+ * @since 5.0.16
68
+ * @return stdClass
69
+ */
70
+ public function get_entry() {
71
+ return $this->entry;
72
+ }
73
+
74
  /**
75
  * Initialize the saved_value property
76
  *
classes/models/FrmForm.php CHANGED
@@ -152,7 +152,7 @@ class FrmForm {
152
 
153
  $form_fields = array( 'form_key', 'name', 'description', 'status', 'parent_form_id' );
154
 
155
- $new_values = self::set_update_options( array(), $values );
156
 
157
  foreach ( $values as $value_key => $value ) {
158
  if ( $value_key && in_array( $value_key, $form_fields ) ) {
@@ -183,9 +183,12 @@ class FrmForm {
183
  }
184
 
185
  /**
 
 
 
186
  * @return array
187
  */
188
- public static function set_update_options( $new_values, $values ) {
189
  if ( ! isset( $values['options'] ) ) {
190
  return $new_values;
191
  }
@@ -198,6 +201,11 @@ class FrmForm {
198
  $options['after_html'] = isset( $values['options']['after_html'] ) ? $values['options']['after_html'] : FrmFormsHelper::get_default_html( 'after' );
199
  $options['submit_html'] = ( isset( $values['options']['submit_html'] ) && '' !== $values['options']['submit_html'] ) ? $values['options']['submit_html'] : FrmFormsHelper::get_default_html( 'submit' );
200
 
 
 
 
 
 
201
  $options = apply_filters( 'frm_form_options_before_update', $options, $values );
202
  $options = self::maybe_filter_form_options( $options );
203
  $new_values['options'] = serialize( $options );
152
 
153
  $form_fields = array( 'form_key', 'name', 'description', 'status', 'parent_form_id' );
154
 
155
+ $new_values = self::set_update_options( array(), $values, array( 'form_id' => $id ) );
156
 
157
  foreach ( $values as $value_key => $value ) {
158
  if ( $value_key && in_array( $value_key, $form_fields ) ) {
183
  }
184
 
185
  /**
186
+ * @param array $new_values
187
+ * @param array $values
188
+ * @param array $args
189
  * @return array
190
  */
191
+ public static function set_update_options( $new_values, $values, $args = array() ) {
192
  if ( ! isset( $values['options'] ) ) {
193
  return $new_values;
194
  }
201
  $options['after_html'] = isset( $values['options']['after_html'] ) ? $values['options']['after_html'] : FrmFormsHelper::get_default_html( 'after' );
202
  $options['submit_html'] = ( isset( $values['options']['submit_html'] ) && '' !== $values['options']['submit_html'] ) ? $values['options']['submit_html'] : FrmFormsHelper::get_default_html( 'submit' );
203
 
204
+ if ( ! empty( $options['success_url'] ) && ! empty( $args['form_id'] ) ) {
205
+ $options['success_url'] = FrmFormsHelper::maybe_add_sanitize_url_attr( $options['success_url'], (int) $args['form_id'] );
206
+ $values['options']['success_url'] = $options['success_url'];
207
+ }
208
+
209
  $options = apply_filters( 'frm_form_options_before_update', $options, $values );
210
  $options = self::maybe_filter_form_options( $options );
211
  $new_values['options'] = serialize( $options );
classes/models/FrmTableHTMLGenerator.php CHANGED
@@ -29,8 +29,9 @@ class FrmTableHTMLGenerator {
29
  /**
30
  * @var string
31
  * @since 2.04
 
32
  */
33
- private $direction = 'ltr';
34
 
35
  /**
36
  * @var bool
@@ -41,14 +42,16 @@ class FrmTableHTMLGenerator {
41
  /**
42
  * @var string
43
  * @since 2.04
 
44
  */
45
- private $table_style = '';
46
 
47
  /**
48
  * @var string
49
  * @since 2.04
 
50
  */
51
- private $td_style = '';
52
 
53
  /**
54
  * FrmTableHTMLGenerator constructor.
@@ -205,10 +208,11 @@ class FrmTableHTMLGenerator {
205
  * Get the table row style
206
  *
207
  * @since 2.04
 
208
  *
209
  * @return string
210
  */
211
- private function tr_style() {
212
 
213
  if ( $this->type === 'shortcode' ) {
214
  $tr_style = ' style="[frm-alt-color]"';
@@ -225,8 +229,9 @@ class FrmTableHTMLGenerator {
225
  * Switch the odd property from true to false or false to true
226
  *
227
  * @since 2.04
 
228
  */
229
- private function switch_odd() {
230
  if ( $this->type !== 'shortcode' ) {
231
  $this->odd = ! $this->odd;
232
  }
@@ -259,8 +264,8 @@ class FrmTableHTMLGenerator {
259
  *
260
  * @since 2.04
261
  *
262
- * @param string $label
263
- * @param string $value
264
  *
265
  * @return string
266
  */
29
  /**
30
  * @var string
31
  * @since 2.04
32
+ * @since 5.0.16 Changed scope from `private` to `protected`.
33
  */
34
+ protected $direction = 'ltr';
35
 
36
  /**
37
  * @var bool
42
  /**
43
  * @var string
44
  * @since 2.04
45
+ * @since 5.0.16 Changed scope from `private` to `protected`.
46
  */
47
+ protected $table_style = '';
48
 
49
  /**
50
  * @var string
51
  * @since 2.04
52
+ * @since 5.0.16 Changed scope from `private` to `protected`.
53
  */
54
+ protected $td_style = '';
55
 
56
  /**
57
  * FrmTableHTMLGenerator constructor.
208
  * Get the table row style
209
  *
210
  * @since 2.04
211
+ * @since 5.0.16 Changed scope from `private` to `protected`.
212
  *
213
  * @return string
214
  */
215
+ protected function tr_style() {
216
 
217
  if ( $this->type === 'shortcode' ) {
218
  $tr_style = ' style="[frm-alt-color]"';
229
  * Switch the odd property from true to false or false to true
230
  *
231
  * @since 2.04
232
+ * @since 5.0.16 Changed scope from `private` to `protected`.
233
  */
234
+ protected function switch_odd() {
235
  if ( $this->type !== 'shortcode' ) {
236
  $this->odd = ! $this->odd;
237
  }
264
  *
265
  * @since 2.04
266
  *
267
+ * @param string $label The label.
268
+ * @param string $value The value.
269
  *
270
  * @return string
271
  */
classes/views/frm-entries/show.php CHANGED
@@ -38,21 +38,31 @@ if ( ! defined( 'ABSPATH' ) ) {
38
  </span>
39
  </h3>
40
  <?php
41
- echo FrmEntriesController::show_entry_shortcode( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
42
- array(
43
- 'id' => $entry->id,
44
- 'entry' => $entry,
45
- 'fields' => $fields,
46
- 'include_blank' => true,
47
- 'include_extras' => 'page, section, password',
48
- 'inline_style' => 0,
49
- 'class' => 'frm-alt-table',
50
- 'show_filename' => true,
51
- 'show_image' => true,
52
- 'size' => 'thumbnail',
53
- 'add_link' => true,
54
- )
55
  );
 
 
 
 
 
 
 
 
 
 
 
 
56
  ?>
57
 
58
  <?php do_action( 'frm_show_entry', $entry ); ?>
38
  </span>
39
  </h3>
40
  <?php
41
+ $show_args = array(
42
+ 'id' => $entry->id,
43
+ 'entry' => $entry,
44
+ 'fields' => $fields,
45
+ 'include_blank' => true,
46
+ 'include_extras' => 'page, section, password',
47
+ 'inline_style' => 0,
48
+ 'class' => 'frm-alt-table',
49
+ 'show_filename' => true,
50
+ 'show_image' => true,
51
+ 'size' => 'thumbnail',
52
+ 'add_link' => true,
 
 
53
  );
54
+
55
+ /**
56
+ * Allows modifying the arguments when showing entry in the Entries page.
57
+ *
58
+ * @since 5.0.16
59
+ *
60
+ * @param array $show_args The arguments.
61
+ * @param array $args Includes `form`.
62
+ */
63
+ $show_args = apply_filters( 'frm_entries_show_args', $show_args, compact( 'form' ) );
64
+
65
+ echo FrmEntriesController::show_entry_shortcode( $show_args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
66
  ?>
67
 
68
  <?php do_action( 'frm_show_entry', $entry ); ?>
classes/views/frm-forms/_publish_box.php CHANGED
@@ -32,6 +32,11 @@ if ( 'settings' == FrmAppHelper::simple_get( 'frm_action', 'sanitize_title' ) )
32
  <?php esc_html_e( 'In Theme', 'formidable' ); ?>
33
  </a>
34
  </li>
 
 
 
 
 
35
  </ul>
36
  </div>
37
  <?php } ?>
32
  <?php esc_html_e( 'In Theme', 'formidable' ); ?>
33
  </a>
34
  </li>
35
+ <?php if ( FrmAppHelper::show_landing_pages() ) { ?>
36
+ <li>
37
+ <?php FrmFormsController::landing_page_preview_option(); ?>
38
+ </li>
39
+ <?php } ?>
40
  </ul>
41
  </div>
42
  <?php } ?>
classes/views/frm-forms/landing-page-preview-option.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ die( 'You are not allowed to call this page directly.' );
4
+ }
5
+ $data = FrmAppHelper::get_landing_page_upgrade_data_params();
6
+ $data_keys = array_keys( $data );
7
+ $params = array();
8
+ foreach ( $data_keys as $key ) {
9
+ $params[ 'data-' . $key ] = $data[ $key ];
10
+ }
11
+ $params['class'] = 'frm_show_upgrade frm_noallow';
12
+ $params['href'] = '#';
13
+ ?>
14
+ <a <?php FrmAppHelper::array_to_html_params( $params, true ); ?>>
15
+ <?php esc_html_e( 'Generate Form Page', 'formidable' ); ?><span class="frm-new-pill"><?php esc_html_e( 'NEW', 'formidable' ); ?></span>
16
+ </a>
css/_single_theme.css.php CHANGED
@@ -222,8 +222,10 @@ if ( '' === $field_height || 'auto' === $field_height ) {
222
  .<?php echo esc_html( $style_class ); ?> .chosen-container-active .chosen-choices{
223
  background-color:<?php echo esc_html( $bg_color_active . $important ); ?>;
224
  border-color:<?php echo esc_html( $border_color_active . $important ); ?>;
 
225
  <?php if ( isset( $remove_box_shadow_active ) && $remove_box_shadow_active ) { ?>
226
  box-shadow:none;
 
227
  <?php } else { ?>
228
  box-shadow:0 1px 1px rgba(0, 0, 0, 0.075) inset, 0 0 8px rgba(<?php echo esc_html( FrmStylesHelper::hex2rgb( $border_color_active ) ); ?>, 0.6);
229
  <?php } ?>
@@ -311,6 +313,7 @@ if ( '' === $field_height || 'auto' === $field_height ) {
311
  background: <?php echo esc_html( $submit_active_bg_color . $important ); ?>;
312
  border-color: <?php echo esc_html( $submit_active_border_color . $important ); ?>;
313
  color: <?php echo esc_html( $submit_active_color . $important ); ?>;
 
314
  }
315
 
316
  .<?php echo esc_html( $style_class ); ?> .frm_loading_prev .frm_prev_page,
@@ -382,7 +385,7 @@ if ( '' === $field_height || 'auto' === $field_height ) {
382
  .<?php echo esc_html( $style_class ); ?> .frm_blank_field input[type=email],
383
  .<?php echo esc_html( $style_class ); ?> .frm_blank_field textarea,
384
  .<?php echo esc_html( $style_class ); ?> .frm_blank_field .mce-edit-area iframe,
385
- .<?php echo esc_html( $style_class ); ?> .frm_blank_field select,
386
  .frm_form_fields_error_style,
387
  .<?php echo esc_html( $style_class ); ?> .frm_blank_field .frm-g-recaptcha iframe,
388
  .<?php echo esc_html( $style_class ); ?> .frm_blank_field .g-recaptcha iframe,
222
  .<?php echo esc_html( $style_class ); ?> .chosen-container-active .chosen-choices{
223
  background-color:<?php echo esc_html( $bg_color_active . $important ); ?>;
224
  border-color:<?php echo esc_html( $border_color_active . $important ); ?>;
225
+ color: var(--text-color);
226
  <?php if ( isset( $remove_box_shadow_active ) && $remove_box_shadow_active ) { ?>
227
  box-shadow:none;
228
+ outline: none;
229
  <?php } else { ?>
230
  box-shadow:0 1px 1px rgba(0, 0, 0, 0.075) inset, 0 0 8px rgba(<?php echo esc_html( FrmStylesHelper::hex2rgb( $border_color_active ) ); ?>, 0.6);
231
  <?php } ?>
313
  background: <?php echo esc_html( $submit_active_bg_color . $important ); ?>;
314
  border-color: <?php echo esc_html( $submit_active_border_color . $important ); ?>;
315
  color: <?php echo esc_html( $submit_active_color . $important ); ?>;
316
+ outline: none;
317
  }
318
 
319
  .<?php echo esc_html( $style_class ); ?> .frm_loading_prev .frm_prev_page,
385
  .<?php echo esc_html( $style_class ); ?> .frm_blank_field input[type=email],
386
  .<?php echo esc_html( $style_class ); ?> .frm_blank_field textarea,
387
  .<?php echo esc_html( $style_class ); ?> .frm_blank_field .mce-edit-area iframe,
388
+ .<?php echo esc_html( $style_class ); ?> .frm_blank_field select:not(.ui-datepicker-month):not(.ui-datepicker-year),
389
  .frm_form_fields_error_style,
390
  .<?php echo esc_html( $style_class ); ?> .frm_blank_field .frm-g-recaptcha iframe,
391
  .<?php echo esc_html( $style_class ); ?> .frm_blank_field .g-recaptcha iframe,
css/custom_theme.css.php CHANGED
@@ -75,6 +75,7 @@ form input.frm_verify{
75
 
76
  .with_frm_style fieldset{
77
  min-width:0;
 
78
  }
79
 
80
  .with_frm_style fieldset fieldset{
@@ -268,6 +269,12 @@ legend.frm_hidden{
268
  border-color:<?php echo esc_html( $defaults['border_color'] . $important ); ?>;
269
  border-color:var(--border-color)<?php echo esc_html( $important ); ?>;
270
  box-shadow:var(--box-shadow)<?php echo esc_html( $important ); ?>;
 
 
 
 
 
 
271
  }
272
 
273
  .with_frm_style input[type=text],
@@ -752,6 +759,7 @@ a.frm_save_draft{
752
  color:var(--check-label-color)<?php echo esc_html( $important ); ?>;
753
  font-weight:<?php echo esc_html( $defaults['check_weight'] . $important ); ?>;
754
  font-weight:var(--check-weight)<?php echo esc_html( $important ); ?>;
 
755
  }
756
 
757
  .with_frm_style .frm_radio input[type=radio],
@@ -770,26 +778,54 @@ a.frm_save_draft{
770
  }
771
 
772
  .with_frm_style .frm_radio input[type=radio]{
773
- -webkit-appearance:radio;
774
  border-radius:50%;
775
  }
776
 
777
  .with_frm_style .frm_checkbox input[type=checkbox]{
778
- -webkit-appearance:checkbox;
779
  border-radius:0;
780
  }
781
 
782
  .with_frm_style .frm_radio input[type=radio],
783
  .with_frm_style .frm_checkbox input[type=checkbox]{
 
 
 
784
  flex: none;
785
  display:inline-block;
786
- margin:4px 5px 0 0;
787
- width:auto;
788
- border:none;
789
- vertical-align:baseline;
 
 
 
 
790
  position: initial; /* override Bootstrap */
791
  }
792
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
793
  .with_frm_style :invalid,
794
  .with_frm_style :-moz-submit-invalid,
795
  .with_frm_style :-moz-ui-invalid{
75
 
76
  .with_frm_style fieldset{
77
  min-width:0;
78
+ display: block; /* Override 2021 theme */
79
  }
80
 
81
  .with_frm_style fieldset fieldset{
269
  border-color:<?php echo esc_html( $defaults['border_color'] . $important ); ?>;
270
  border-color:var(--border-color)<?php echo esc_html( $important ); ?>;
271
  box-shadow:var(--box-shadow)<?php echo esc_html( $important ); ?>;
272
+ float: none;
273
+ }
274
+
275
+ .with_frm_style input[type=radio]:after,
276
+ .with_frm_style input[type=checkbox]:after {
277
+ display: none; /* 2021 conflict */
278
  }
279
 
280
  .with_frm_style input[type=text],
759
  color:var(--check-label-color)<?php echo esc_html( $important ); ?>;
760
  font-weight:<?php echo esc_html( $defaults['check_weight'] . $important ); ?>;
761
  font-weight:var(--check-weight)<?php echo esc_html( $important ); ?>;
762
+ line-height: 1.3;
763
  }
764
 
765
  .with_frm_style .frm_radio input[type=radio],
778
  }
779
 
780
  .with_frm_style .frm_radio input[type=radio]{
 
781
  border-radius:50%;
782
  }
783
 
784
  .with_frm_style .frm_checkbox input[type=checkbox]{
 
785
  border-radius:0;
786
  }
787
 
788
  .with_frm_style .frm_radio input[type=radio],
789
  .with_frm_style .frm_checkbox input[type=checkbox]{
790
+ -webkit-appearance: none;
791
+ appearance: none;
792
+ background-color: var(--bg-color);
793
  flex: none;
794
  display:inline-block;
795
+ margin: 0 5px 0 0;
796
+ color: var(--border-color);
797
+ width: 18px;
798
+ min-width: 18px;
799
+ height: 18px;
800
+ border: 1px solid currentColor;
801
+ border-color: var(--border-color);
802
+ vertical-align: middle;
803
  position: initial; /* override Bootstrap */
804
  }
805
 
806
+ .with_frm_style .frm_radio input[type=radio]:before,
807
+ .with_frm_style .frm_checkbox input[type=checkbox]:before {
808
+ content: '';
809
+ width: 12px;
810
+ height: 12px;
811
+ border-radius: 50%;
812
+ transform: scale(0);
813
+ transition: 120ms transform ease-in-out;
814
+ box-shadow: inset 10px 10px var(--text-color);
815
+ display: block;
816
+ margin: 2px 0 0 2px;
817
+ }
818
+
819
+ .with_frm_style .frm_checkbox input[type=checkbox]:before{
820
+ clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
821
+ border-radius: 0;
822
+ }
823
+
824
+ .with_frm_style .frm_radio input[type=radio]:checked:before,
825
+ .with_frm_style .frm_checkbox input[type=checkbox]:checked:before {
826
+ transform: scale(1);
827
+ }
828
+
829
  .with_frm_style :invalid,
830
  .with_frm_style :-moz-submit-invalid,
831
  .with_frm_style :-moz-ui-invalid{
css/frm_admin.css CHANGED
@@ -8425,12 +8425,20 @@ Responsive Design
8425
  background: #C4C4C4;
8426
  }
8427
 
8428
-
8429
  .frm-sortable-helper,
8430
  .frm-multiselect-key-is-down li.form-field:not(.edit_field_type_divider) {
8431
  pointer-events: none;
8432
  }
8433
 
 
 
 
 
 
 
 
 
 
8434
  #frm_banner {
8435
  width: 100%;
8436
  color: #fff;
8425
  background: #C4C4C4;
8426
  }
8427
 
 
8428
  .frm-sortable-helper,
8429
  .frm-multiselect-key-is-down li.form-field:not(.edit_field_type_divider) {
8430
  pointer-events: none;
8431
  }
8432
 
8433
+ .frm-new-pill {
8434
+ background: #F47449;
8435
+ border-radius: 13px;
8436
+ padding: 2px 6px;
8437
+ color: #fff;
8438
+ margin-left: 5px;
8439
+ font-size: 9px;
8440
+ }
8441
+
8442
  #frm_banner {
8443
  width: 100%;
8444
  color: #fff;
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.0.15
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.0.16
6
  Plugin URI: https://formidableforms.com/
7
  Author URI: https://formidableforms.com/
8
  Author: Strategy11
js/formidable.js CHANGED
@@ -262,7 +262,7 @@ function frmFrontFormJS() {
262
  fieldID = '',
263
  fileID = field.getAttribute( 'data-frmfile' );
264
 
265
- if ( field.type === 'hidden' && fileID === null && ! hasClass( field, 'ssa_appointment_form_field_appointment_id' ) ) {
266
  return errors;
267
  }
268
 
@@ -343,6 +343,14 @@ function frmFrontFormJS() {
343
  return 'string' === typeof name && '[typed]' === name.substr( -7 );
344
  }
345
 
 
 
 
 
 
 
 
 
346
  function getFileVals( fileID ) {
347
  var val = '',
348
  fileFields = jQuery( 'input[name="file' + fileID + '"], input[name="file' + fileID + '[]"], input[name^="item_meta[' + fileID + ']"]' );
262
  fieldID = '',
263
  fileID = field.getAttribute( 'data-frmfile' );
264
 
265
+ if ( field.type === 'hidden' && fileID === null && ! isAppointmentField( field ) && ! isInlineDatepickerField( field ) ) {
266
  return errors;
267
  }
268
 
343
  return 'string' === typeof name && '[typed]' === name.substr( -7 );
344
  }
345
 
346
+ function isAppointmentField( field ) {
347
+ return hasClass( field, 'ssa_appointment_form_field_appointment_id' );
348
+ }
349
+
350
+ function isInlineDatepickerField( field ) {
351
+ return 'hidden' === field.type && '_alt' === field.id.substr( -4 ) && hasClass( field.nextElementSibling, 'frm_date_inline' );
352
+ }
353
+
354
  function getFileVals( fileID ) {
355
  var val = '',
356
  fileFields = jQuery( 'input[name="file' + fileID + '"], input[name="file' + fileID + '[]"], input[name^="item_meta[' + fileID + ']"]' );
js/formidable.min.js CHANGED
@@ -7,37 +7,37 @@ if(requiredFields.length)for(r=0,rl=requiredFields.length;r<rl;r++){if(hasClass(
7
  "password")errors=checkPasswordField(field,errors);else if(field.type==="url")errors=checkUrlField(field,errors);else if(field.pattern!==null)errors=checkPatternField(field,errors)}errors=validateRecaptcha(object,errors);return errors}function hasClass(element,targetClass){var className=" "+element.className+" ";return-1!==className.indexOf(" "+targetClass+" ")}function maybeValidateChange(field){if(field.type==="url")maybeAddHttpToUrl(field);if(jQuery(field).closest("form").hasClass("frm_js_validate"))validateField(field)}
8
  function maybeAddHttpToUrl(field){var url=field.value;var matches=url.match(/^(https?|ftps?|mailto|news|feed|telnet):/);if(field.value!==""&&matches===null)field.value="http://"+url}function validateField(field){var key,errors=[],$fieldCont=jQuery(field).closest(".frm_form_field");if($fieldCont.hasClass("frm_required_field")&&!jQuery(field).hasClass("frm_optional"))errors=checkRequiredField(field,errors);if(errors.length<1)if(field.type==="email")errors=checkEmailField(field,errors);else if(field.type===
9
  "password")errors=checkPasswordField(field,errors);else if(field.type==="number")errors=checkNumberField(field,errors);else if(field.type==="url")errors=checkUrlField(field,errors);else if(field.pattern!==null)errors=checkPatternField(field,errors);removeFieldError($fieldCont);if(Object.keys(errors).length>0)for(key in errors)addFieldError($fieldCont,key,errors)}function checkRequiredField(field,errors){var checkGroup,tempVal,i,placeholder,val="",fieldID="",fileID=field.getAttribute("data-frmfile");
10
- if(field.type==="hidden"&&fileID===null&&!hasClass(field,"ssa_appointment_form_field_appointment_id"))return errors;if(field.type==="checkbox"||field.type==="radio"){checkGroup=jQuery('input[name="'+field.name+'"]').closest(".frm_required_field").find("input:checked");jQuery(checkGroup).each(function(){val=this.value})}else if(field.type==="file"||fileID){if(typeof fileID==="undefined"){fileID=getFieldId(field,true);fileID=fileID.replace("file","")}if(typeof errors[fileID]==="undefined")val=getFileVals(fileID);
11
  fieldID=fileID}else{if(hasClass(field,"frm_pos_none"))return errors;val=jQuery(field).val();if(val===null)val="";else if(typeof val!=="string"){tempVal=val;val="";for(i=0;i<tempVal.length;i++)if(tempVal[i]!=="")val=tempVal[i]}if(hasClass(field,"frm_other_input")){fieldID=getFieldId(field,false);if(val==="")field=document.getElementById(field.id.replace("-otext",""))}else fieldID=getFieldId(field,true);if(hasClass(field,"frm_time_select"))fieldID=fieldID.replace("-H","").replace("-m","");else if(isSignatureField(field)){if(val===
12
  "")val=jQuery(field).closest(".frm_form_field").find('[name="'+field.getAttribute("name").replace("[typed]","[output]")+'"]').val();fieldID=fieldID.replace("-typed","")}placeholder=field.getAttribute("data-frmplaceholder");if(placeholder!==null&&val===placeholder)val=""}if(val===""){if(fieldID==="")fieldID=getFieldId(field,true);if(!(fieldID in errors))errors[fieldID]=getFieldValidationMessage(field,"data-reqmsg")}return errors}function isSignatureField(field){var name=field.getAttribute("name");
13
- return"string"===typeof name&&"[typed]"===name.substr(-7)}function getFileVals(fileID){var val="",fileFields=jQuery('input[name="file'+fileID+'"], input[name="file'+fileID+'[]"], input[name^="item_meta['+fileID+']"]');fileFields.each(function(){if(val==="")val=this.value});return val}function checkUrlField(field,errors){var fieldID,url=field.value;if(url!==""&&!/^http(s)?:\/\/(?:localhost|(?:[\da-z\.-]+\.[\da-z\.-]+))/i.test(url)){fieldID=getFieldId(field,true);if(!(fieldID in errors))errors[fieldID]=
14
- getFieldValidationMessage(field,"data-invmsg")}return errors}function checkEmailField(field,errors){var fieldID=getFieldId(field,true),pattern=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/i;if(""!==field.value&&pattern.test(field.value)===false)errors[fieldID]=getFieldValidationMessage(field,"data-invmsg");confirmField(field,errors);return errors}function checkPasswordField(field,errors){confirmField(field,
15
- errors);return errors}function confirmField(field,errors){var value,confirmValue,firstField,fieldID=getFieldId(field,true),strippedId=field.id.replace("conf_",""),strippedFieldID=fieldID.replace("conf_",""),confirmField=document.getElementById(strippedId.replace("field_","field_conf_"));if(confirmField===null||typeof errors["conf_"+strippedFieldID]!=="undefined")return;if(fieldID!==strippedFieldID){firstField=document.getElementById(strippedId);value=firstField.value;confirmValue=confirmField.value;
16
- if(""!==value&&""!==confirmValue&&value!==confirmValue)errors["conf_"+strippedFieldID]=getFieldValidationMessage(confirmField,"data-confmsg")}else validateField(confirmField)}function checkNumberField(field,errors){var fieldID,number=field.value;if(number!==""&&isNaN(number/1)!==false){fieldID=getFieldId(field,true);if(!(fieldID in errors))errors[fieldID]=getFieldValidationMessage(field,"data-invmsg")}return errors}function checkPatternField(field,errors){var fieldID,text=field.value,format=getFieldValidationMessage(field,
17
- "pattern");if(format!==""&&text!==""){fieldID=getFieldId(field,true);if(!(fieldID in errors)){format=new RegExp("^"+format+"$","i");if(format.test(text)===false)errors[fieldID]=getFieldValidationMessage(field,"data-invmsg")}}return errors}function hasInvisibleRecaptcha(object){var recaptcha,recaptchaID,alreadyChecked;if(isGoingToPrevPage(object))return false;recaptcha=jQuery(object).find('.frm-g-recaptcha[data-size="invisible"], .g-recaptcha[data-size="invisible"]');if(recaptcha.length){recaptchaID=
18
- recaptcha.data("rid");alreadyChecked=grecaptcha.getResponse(recaptchaID);if(alreadyChecked.length===0)return recaptcha;else return false}else return false}function executeInvisibleRecaptcha(invisibleRecaptcha){var recaptchaID=invisibleRecaptcha.data("rid");grecaptcha.reset(recaptchaID);grecaptcha.execute(recaptchaID)}function validateRecaptcha(form,errors){var recaptchaID,response,fieldContainer,fieldID,$recaptcha=jQuery(form).find(".frm-g-recaptcha");if($recaptcha.length){recaptchaID=$recaptcha.data("rid");
19
- try{response=grecaptcha.getResponse(recaptchaID)}catch(e){if(jQuery(form).find('input[name="recaptcha_checked"]').length)return errors;else response=""}if(response.length===0){fieldContainer=$recaptcha.closest(".frm_form_field");fieldID=fieldContainer.attr("id").replace("frm_field_","").replace("_container","");errors[fieldID]=""}}return errors}function getFieldValidationMessage(field,messageType){var msg,errorHtml;msg=field.getAttribute(messageType);if(null===msg)msg="";if(""!==msg&&shouldWrapErrorHtmlAroundMessageType(messageType)){errorHtml=
20
- field.getAttribute("data-error-html");if(null!==errorHtml){errorHtml=errorHtml.replace(/\+/g,"%20");msg=decodeURIComponent(errorHtml).replace("[error]",msg);msg=msg.replace("[key]",getFieldId(field,false))}}return msg}function shouldWrapErrorHtmlAroundMessageType(type){return"pattern"!==type}function shouldJSValidate(object){var validate=jQuery(object).hasClass("frm_js_validate");if(validate&&typeof frmProForm!=="undefined"&&(frmProForm.savingDraft(object)||frmProForm.goingToPreviousPage(object)))validate=
21
- false;return validate}function getFormErrors(object,action){var fieldset;if(typeof action==="undefined")jQuery(object).find('input[name="frm_action"]').val();fieldset=jQuery(object).find(".frm_form_field");fieldset.addClass("frm_doing_ajax");jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:jQuery(object).serialize()+"&action=frm_entries_"+action+"&nonce="+frm_js.nonce,success:function(response){var formID,replaceContent,pageOrder,formReturned,contSubmit,delay,$fieldCont,key,inCollapsedSection,frmTrigger,
22
- defaultResponse={"content":"","errors":{},"pass":false};if(response===null)response=defaultResponse;response=response.replace(/^\s+|\s+$/g,"");if(response.indexOf("{")===0)response=JSON.parse(response);else response=defaultResponse;if(typeof response.redirect!=="undefined"){jQuery(document).trigger("frmBeforeFormRedirect",[object,response]);window.location=response.redirect}else if(response.content!==""){removeSubmitLoading(jQuery(object));if(frm_js.offset!=-1)frmFrontForm.scrollMsg(jQuery(object),
23
- false);formID=jQuery(object).find('input[name="form_id"]').val();response.content=response.content.replace(/ frm_pro_form /g," frm_pro_form frm_no_hide ");replaceContent=jQuery(object).closest(".frm_forms");removeAddedScripts(replaceContent,formID);delay=maybeSlideOut(replaceContent,response.content);setTimeout(function(){var container,input,previousInput;replaceContent.replaceWith(response.content);addUrlParam(response);if(typeof frmThemeOverride_frmAfterSubmit==="function"){pageOrder=jQuery('input[name="frm_page_order_'+
24
- formID+'"]').val();formReturned=jQuery(response.content).find('input[name="form_id"]').val();frmThemeOverride_frmAfterSubmit(formReturned,pageOrder,response.content,object)}if(typeof response.recaptcha!=="undefined"){container=jQuery("#frm_form_"+formID+"_container").find(".frm_fields_container");input='<input type="hidden" name="recaptcha_checked" value="'+response.recaptcha+'">';previousInput=container.find('input[name="recaptcha_checked"]');if(previousInput.length)previousInput.replaceWith(input);
25
- else container.append(input)}afterFormSubmitted(object,response)},delay)}else if(Object.keys(response.errors).length){removeSubmitLoading(jQuery(object),"enable");contSubmit=true;removeAllErrors();$fieldCont=null;for(key in response.errors){$fieldCont=jQuery(object).find("#frm_field_"+key+"_container");if($fieldCont.length){if(!$fieldCont.is(":visible")){inCollapsedSection=$fieldCont.closest(".frm_toggle_container");if(inCollapsedSection.length){frmTrigger=inCollapsedSection.prev();if(!frmTrigger.hasClass("frm_trigger"))frmTrigger=
26
- frmTrigger.prev(".frm_trigger");frmTrigger.trigger("click")}}if($fieldCont.is(":visible")){addFieldError($fieldCont,key,response.errors);contSubmit=false}}}jQuery(object).find(".frm-g-recaptcha, .g-recaptcha").each(function(){var $recaptcha=jQuery(this),recaptchaID=$recaptcha.data("rid");if(typeof grecaptcha!=="undefined"&&grecaptcha)if(recaptchaID)grecaptcha.reset(recaptchaID);else grecaptcha.reset()});jQuery(document).trigger("frmFormErrors",[object,response]);fieldset.removeClass("frm_doing_ajax");
27
- scrollToFirstField(object);if(contSubmit)object.submit();else{jQuery(object).prepend(response.error_message);checkForErrorsAndMaybeSetFocus()}}else{showFileLoading(object);object.submit()}},error:function(){jQuery(object).find('input[type="submit"], input[type="button"]').prop("disabled",false);object.submit()}})}function afterFormSubmitted(object,response){var formCompleted=jQuery(response.content).find(".frm_message");if(formCompleted.length)jQuery(document).trigger("frmFormComplete",[object,response]);
28
- else jQuery(document).trigger("frmPageChanged",[object,response])}function removeAddedScripts(formContainer,formID){var endReplace=jQuery(".frm_end_ajax_"+formID);if(endReplace.length){formContainer.nextUntil(".frm_end_ajax_"+formID).remove();endReplace.remove()}}function maybeSlideOut(oldContent,newContent){var c,newClass="frm_slideout";if(newContent.indexOf(" frm_slide")!==-1){c=oldContent.children();if(newContent.indexOf(" frm_going_back")!==-1)newClass+=" frm_going_back";c.removeClass("frm_going_back");
29
- c.addClass(newClass);return 300}return 0}function addUrlParam(response){var url;if(history.pushState&&typeof response.page!=="undefined"){url=addQueryVar("frm_page",response.page);window.history.pushState({"html":response.html},"","?"+url)}}function addQueryVar(key,value){var kvp,i,x;key=encodeURI(key);value=encodeURI(value);kvp=document.location.search.substr(1).split("&");i=kvp.length;while(i--){x=kvp[i].split("=");if(x[0]==key){x[1]=value;kvp[i]=x.join("=");break}}if(i<0)kvp[kvp.length]=[key,value].join("=");
30
- return kvp.join("&")}function addFieldError($fieldCont,key,jsErrors){var input,id,describedBy;if($fieldCont.length&&$fieldCont.is(":visible")){$fieldCont.addClass("frm_blank_field");input=$fieldCont.find("input, select, textarea");id="frm_error_field_"+key;describedBy=input.attr("aria-describedby");if(typeof frmThemeOverride_frmPlaceError==="function")frmThemeOverride_frmPlaceError(key,jsErrors);else{if(-1!==jsErrors[key].indexOf("<div"))$fieldCont.append(jsErrors[key]);else $fieldCont.append('<div class="frm_error" id="'+
31
- id+'">'+jsErrors[key]+"</div>");if(typeof describedBy==="undefined")describedBy=id;else if(describedBy.indexOf(id)===-1)describedBy=describedBy+" "+id;input.attr("aria-describedby",describedBy)}input.attr("aria-invalid",true);jQuery(document).trigger("frmAddFieldError",[$fieldCont,key,jsErrors])}}function removeFieldError($fieldCont){var errorMessage=$fieldCont.find(".frm_error"),errorId=errorMessage.attr("id"),input=$fieldCont.find("input, select, textarea"),describedBy=input.attr("aria-describedby");
32
- $fieldCont.removeClass("frm_blank_field has-error");errorMessage.remove();input.attr("aria-invalid",false);if(typeof describedBy!=="undefined"){describedBy=describedBy.replace(errorId,"");input.attr("aria-describedby",describedBy)}}function removeAllErrors(){jQuery(".form-field").removeClass("frm_blank_field has-error");jQuery(".form-field .frm_error").replaceWith("");jQuery(".frm_error_style").remove()}function scrollToFirstField(object){var field=jQuery(object).find(".frm_blank_field").first();
33
- if(field.length)frmFrontForm.scrollMsg(field,object,true)}function showSubmitLoading($object){showLoadingIndicator($object);disableSubmitButton($object);disableSaveDraft($object)}function showLoadingIndicator($object){if(!$object.hasClass("frm_loading_form")&&!$object.hasClass("frm_loading_prev")){addLoadingClass($object);$object.trigger("frmStartFormLoading")}}function addLoadingClass($object){var loadingClass=isGoingToPrevPage($object)?"frm_loading_prev":"frm_loading_form";$object.addClass(loadingClass)}
34
- function isGoingToPrevPage($object){return typeof frmProForm!=="undefined"&&frmProForm.goingToPreviousPage($object)}function removeSubmitLoading($object,enable,processesRunning){var loadingForm;if(processesRunning>0)return;loadingForm=jQuery(".frm_loading_form");loadingForm.removeClass("frm_loading_form");loadingForm.removeClass("frm_loading_prev");loadingForm.trigger("frmEndFormLoading");if(enable==="enable"){enableSubmitButton(loadingForm);enableSaveDraft(loadingForm)}}function showFileLoading(object){var fileval,
35
- loading=document.getElementById("frm_loading");if(loading!==null){fileval=jQuery(object).find("input[type=file]").val();if(typeof fileval!=="undefined"&&fileval!=="")setTimeout(function(){jQuery(loading).fadeIn("slow")},2E3)}}function clearDefault(){toggleDefault(jQuery(this),"clear")}function replaceDefault(){toggleDefault(jQuery(this),"replace")}function toggleDefault($thisField,e){var thisVal,v=$thisField.data("frmval").replace(/(\n|\r\n)/g,"\r");if(v===""||typeof v==="undefined")return false;
36
- thisVal=$thisField.val().replace(/(\n|\r\n)/g,"\r");if("replace"===e){if(thisVal==="")$thisField.addClass("frm_default").val(v)}else if(thisVal==v)$thisField.removeClass("frm_default").val("")}function resendEmail(){var $link=jQuery(this),entryId=this.getAttribute("data-eid"),formId=this.getAttribute("data-fid"),label=$link.find(".frm_link_label");if(label.length<1)label=$link;label.append('<span class="frm-wait"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_entries_send_email",
37
- entry_id:entryId,form_id:formId,nonce:frm_js.nonce},success:function(msg){var admin=document.getElementById("wpbody");if(admin===null)label.html(msg);else{label.html("");$link.after(msg)}}});return false}function confirmClick(){var message=jQuery(this).data("frmconfirm");return confirm(message)}function toggleDiv(){var div=jQuery(this).data("frmtoggle");if(jQuery(div).is(":visible"))jQuery(div).slideUp("fast");else jQuery(div).slideDown("fast");return false}function addIndexOfFallbackForIE8(){var len,
38
- from;if(!Array.prototype.indexOf)Array.prototype.indexOf=function(elt){len=this.length>>>0;from=Number(arguments[1])||0;from=from<0?Math.ceil(from):Math.floor(from);if(from<0)from+=len;for(;from<len;from++)if(from in this&&this[from]===elt)return from;return-1}}function addTrimFallbackForIE8(){if(typeof String.prototype.trim!=="function")String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}}function addFilterFallbackForIE8(){var t,len,res,thisp,i,val;if(!Array.prototype.filter)Array.prototype.filter=
39
- function(fun){if(this===void 0||this===null)throw new TypeError;t=Object(this);len=t.length>>>0;if(typeof fun!=="function")throw new TypeError;res=[];thisp=arguments[1];for(i=0;i<len;i++)if(i in t){val=t[i];if(fun.call(thisp,val,i,t))res.push(val)}return res}}function addKeysFallbackForIE8(){var keys,i;if(!Object.keys)Object.keys=function(obj){keys=[];for(i in obj)if(obj.hasOwnProperty(i))keys.push(i);return keys}}function onHoneypotFieldChange(){var css=jQuery(this).css("box-shadow");if(css.match(/inset/))this.parentNode.removeChild(this)}
40
- function changeFocusWhenClickComboFieldLabel(){var label;var comboInputsContainer=document.querySelectorAll(".frm_combo_inputs_container");comboInputsContainer.forEach(function(inputsContainer){if(!inputsContainer.closest(".frm_form_field"))return;label=inputsContainer.closest(".frm_form_field").querySelector(".frm_primary_label");if(!label)return;label.addEventListener("click",function(e){inputsContainer.querySelector(".frm_form_field:first-child input, .frm_form_field:first-child select, .frm_form_field:first-child textarea").focus()})})}
41
  function checkForErrorsAndMaybeSetFocus(){var errors,element,timeoutCallback;errors=document.querySelectorAll(".frm_form_field .frm_error");if(!errors.length)return;element=errors[0];do{element=element.previousSibling;if(-1!==["input","select","textarea"].indexOf(element.nodeName.toLowerCase())){element.focus();break}if("undefined"!==typeof element.classList){if(element.classList.contains("html-active"))timeoutCallback=function(){var textarea=element.querySelector("textarea");if(null!==textarea)textarea.focus()};
42
  else if(element.classList.contains("tmce-active"))timeoutCallback=function(){tinyMCE.activeEditor.focus()};if("function"===typeof timeoutCallback){setTimeout(timeoutCallback,0);break}}}while(element.previousSibling)}return{init:function(){jQuery(document).off("submit.formidable",".frm-show-form");jQuery(document).on("submit.formidable",".frm-show-form",frmFrontForm.submitForm);jQuery(".frm-show-form input[onblur], .frm-show-form textarea[onblur]").each(function(){if(jQuery(this).val()==="")jQuery(this).trigger("blur")});
43
  jQuery(document).on("focus",".frm_toggle_default",clearDefault);jQuery(document).on("blur",".frm_toggle_default",replaceDefault);jQuery(".frm_toggle_default").trigger("blur");jQuery(document.getElementById("frm_resend_email")).on("click",resendEmail);jQuery(document).on("change",'.frm-show-form input[name^="item_meta"], .frm-show-form select[name^="item_meta"], .frm-show-form textarea[name^="item_meta"]',frmFrontForm.fieldValueChanged);jQuery(document).on("change keyup",".frm-show-form .frm_inside_container input, .frm-show-form .frm_inside_container select, .frm-show-form .frm_inside_container textarea",
7
  "password")errors=checkPasswordField(field,errors);else if(field.type==="url")errors=checkUrlField(field,errors);else if(field.pattern!==null)errors=checkPatternField(field,errors)}errors=validateRecaptcha(object,errors);return errors}function hasClass(element,targetClass){var className=" "+element.className+" ";return-1!==className.indexOf(" "+targetClass+" ")}function maybeValidateChange(field){if(field.type==="url")maybeAddHttpToUrl(field);if(jQuery(field).closest("form").hasClass("frm_js_validate"))validateField(field)}
8
  function maybeAddHttpToUrl(field){var url=field.value;var matches=url.match(/^(https?|ftps?|mailto|news|feed|telnet):/);if(field.value!==""&&matches===null)field.value="http://"+url}function validateField(field){var key,errors=[],$fieldCont=jQuery(field).closest(".frm_form_field");if($fieldCont.hasClass("frm_required_field")&&!jQuery(field).hasClass("frm_optional"))errors=checkRequiredField(field,errors);if(errors.length<1)if(field.type==="email")errors=checkEmailField(field,errors);else if(field.type===
9
  "password")errors=checkPasswordField(field,errors);else if(field.type==="number")errors=checkNumberField(field,errors);else if(field.type==="url")errors=checkUrlField(field,errors);else if(field.pattern!==null)errors=checkPatternField(field,errors);removeFieldError($fieldCont);if(Object.keys(errors).length>0)for(key in errors)addFieldError($fieldCont,key,errors)}function checkRequiredField(field,errors){var checkGroup,tempVal,i,placeholder,val="",fieldID="",fileID=field.getAttribute("data-frmfile");
10
+ if(field.type==="hidden"&&fileID===null&&!isAppointmentField(field)&&!isInlineDatepickerField(field))return errors;if(field.type==="checkbox"||field.type==="radio"){checkGroup=jQuery('input[name="'+field.name+'"]').closest(".frm_required_field").find("input:checked");jQuery(checkGroup).each(function(){val=this.value})}else if(field.type==="file"||fileID){if(typeof fileID==="undefined"){fileID=getFieldId(field,true);fileID=fileID.replace("file","")}if(typeof errors[fileID]==="undefined")val=getFileVals(fileID);
11
  fieldID=fileID}else{if(hasClass(field,"frm_pos_none"))return errors;val=jQuery(field).val();if(val===null)val="";else if(typeof val!=="string"){tempVal=val;val="";for(i=0;i<tempVal.length;i++)if(tempVal[i]!=="")val=tempVal[i]}if(hasClass(field,"frm_other_input")){fieldID=getFieldId(field,false);if(val==="")field=document.getElementById(field.id.replace("-otext",""))}else fieldID=getFieldId(field,true);if(hasClass(field,"frm_time_select"))fieldID=fieldID.replace("-H","").replace("-m","");else if(isSignatureField(field)){if(val===
12
  "")val=jQuery(field).closest(".frm_form_field").find('[name="'+field.getAttribute("name").replace("[typed]","[output]")+'"]').val();fieldID=fieldID.replace("-typed","")}placeholder=field.getAttribute("data-frmplaceholder");if(placeholder!==null&&val===placeholder)val=""}if(val===""){if(fieldID==="")fieldID=getFieldId(field,true);if(!(fieldID in errors))errors[fieldID]=getFieldValidationMessage(field,"data-reqmsg")}return errors}function isSignatureField(field){var name=field.getAttribute("name");
13
+ return"string"===typeof name&&"[typed]"===name.substr(-7)}function isAppointmentField(field){return hasClass(field,"ssa_appointment_form_field_appointment_id")}function isInlineDatepickerField(field){return"hidden"===field.type&&"_alt"===field.id.substr(-4)&&hasClass(field.nextElementSibling,"frm_date_inline")}function getFileVals(fileID){var val="",fileFields=jQuery('input[name="file'+fileID+'"], input[name="file'+fileID+'[]"], input[name^="item_meta['+fileID+']"]');fileFields.each(function(){if(val===
14
+ "")val=this.value});return val}function checkUrlField(field,errors){var fieldID,url=field.value;if(url!==""&&!/^http(s)?:\/\/(?:localhost|(?:[\da-z\.-]+\.[\da-z\.-]+))/i.test(url)){fieldID=getFieldId(field,true);if(!(fieldID in errors))errors[fieldID]=getFieldValidationMessage(field,"data-invmsg")}return errors}function checkEmailField(field,errors){var fieldID=getFieldId(field,true),pattern=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/i;
15
+ if(""!==field.value&&pattern.test(field.value)===false)errors[fieldID]=getFieldValidationMessage(field,"data-invmsg");confirmField(field,errors);return errors}function checkPasswordField(field,errors){confirmField(field,errors);return errors}function confirmField(field,errors){var value,confirmValue,firstField,fieldID=getFieldId(field,true),strippedId=field.id.replace("conf_",""),strippedFieldID=fieldID.replace("conf_",""),confirmField=document.getElementById(strippedId.replace("field_","field_conf_"));
16
+ if(confirmField===null||typeof errors["conf_"+strippedFieldID]!=="undefined")return;if(fieldID!==strippedFieldID){firstField=document.getElementById(strippedId);value=firstField.value;confirmValue=confirmField.value;if(""!==value&&""!==confirmValue&&value!==confirmValue)errors["conf_"+strippedFieldID]=getFieldValidationMessage(confirmField,"data-confmsg")}else validateField(confirmField)}function checkNumberField(field,errors){var fieldID,number=field.value;if(number!==""&&isNaN(number/1)!==false){fieldID=
17
+ getFieldId(field,true);if(!(fieldID in errors))errors[fieldID]=getFieldValidationMessage(field,"data-invmsg")}return errors}function checkPatternField(field,errors){var fieldID,text=field.value,format=getFieldValidationMessage(field,"pattern");if(format!==""&&text!==""){fieldID=getFieldId(field,true);if(!(fieldID in errors)){format=new RegExp("^"+format+"$","i");if(format.test(text)===false)errors[fieldID]=getFieldValidationMessage(field,"data-invmsg")}}return errors}function hasInvisibleRecaptcha(object){var recaptcha,
18
+ recaptchaID,alreadyChecked;if(isGoingToPrevPage(object))return false;recaptcha=jQuery(object).find('.frm-g-recaptcha[data-size="invisible"], .g-recaptcha[data-size="invisible"]');if(recaptcha.length){recaptchaID=recaptcha.data("rid");alreadyChecked=grecaptcha.getResponse(recaptchaID);if(alreadyChecked.length===0)return recaptcha;else return false}else return false}function executeInvisibleRecaptcha(invisibleRecaptcha){var recaptchaID=invisibleRecaptcha.data("rid");grecaptcha.reset(recaptchaID);grecaptcha.execute(recaptchaID)}
19
+ function validateRecaptcha(form,errors){var recaptchaID,response,fieldContainer,fieldID,$recaptcha=jQuery(form).find(".frm-g-recaptcha");if($recaptcha.length){recaptchaID=$recaptcha.data("rid");try{response=grecaptcha.getResponse(recaptchaID)}catch(e){if(jQuery(form).find('input[name="recaptcha_checked"]').length)return errors;else response=""}if(response.length===0){fieldContainer=$recaptcha.closest(".frm_form_field");fieldID=fieldContainer.attr("id").replace("frm_field_","").replace("_container",
20
+ "");errors[fieldID]=""}}return errors}function getFieldValidationMessage(field,messageType){var msg,errorHtml;msg=field.getAttribute(messageType);if(null===msg)msg="";if(""!==msg&&shouldWrapErrorHtmlAroundMessageType(messageType)){errorHtml=field.getAttribute("data-error-html");if(null!==errorHtml){errorHtml=errorHtml.replace(/\+/g,"%20");msg=decodeURIComponent(errorHtml).replace("[error]",msg);msg=msg.replace("[key]",getFieldId(field,false))}}return msg}function shouldWrapErrorHtmlAroundMessageType(type){return"pattern"!==
21
+ type}function shouldJSValidate(object){var validate=jQuery(object).hasClass("frm_js_validate");if(validate&&typeof frmProForm!=="undefined"&&(frmProForm.savingDraft(object)||frmProForm.goingToPreviousPage(object)))validate=false;return validate}function getFormErrors(object,action){var fieldset;if(typeof action==="undefined")jQuery(object).find('input[name="frm_action"]').val();fieldset=jQuery(object).find(".frm_form_field");fieldset.addClass("frm_doing_ajax");jQuery.ajax({type:"POST",url:frm_js.ajax_url,
22
+ data:jQuery(object).serialize()+"&action=frm_entries_"+action+"&nonce="+frm_js.nonce,success:function(response){var formID,replaceContent,pageOrder,formReturned,contSubmit,delay,$fieldCont,key,inCollapsedSection,frmTrigger,defaultResponse={"content":"","errors":{},"pass":false};if(response===null)response=defaultResponse;response=response.replace(/^\s+|\s+$/g,"");if(response.indexOf("{")===0)response=JSON.parse(response);else response=defaultResponse;if(typeof response.redirect!=="undefined"){jQuery(document).trigger("frmBeforeFormRedirect",
23
+ [object,response]);window.location=response.redirect}else if(response.content!==""){removeSubmitLoading(jQuery(object));if(frm_js.offset!=-1)frmFrontForm.scrollMsg(jQuery(object),false);formID=jQuery(object).find('input[name="form_id"]').val();response.content=response.content.replace(/ frm_pro_form /g," frm_pro_form frm_no_hide ");replaceContent=jQuery(object).closest(".frm_forms");removeAddedScripts(replaceContent,formID);delay=maybeSlideOut(replaceContent,response.content);setTimeout(function(){var container,
24
+ input,previousInput;replaceContent.replaceWith(response.content);addUrlParam(response);if(typeof frmThemeOverride_frmAfterSubmit==="function"){pageOrder=jQuery('input[name="frm_page_order_'+formID+'"]').val();formReturned=jQuery(response.content).find('input[name="form_id"]').val();frmThemeOverride_frmAfterSubmit(formReturned,pageOrder,response.content,object)}if(typeof response.recaptcha!=="undefined"){container=jQuery("#frm_form_"+formID+"_container").find(".frm_fields_container");input='<input type="hidden" name="recaptcha_checked" value="'+
25
+ response.recaptcha+'">';previousInput=container.find('input[name="recaptcha_checked"]');if(previousInput.length)previousInput.replaceWith(input);else container.append(input)}afterFormSubmitted(object,response)},delay)}else if(Object.keys(response.errors).length){removeSubmitLoading(jQuery(object),"enable");contSubmit=true;removeAllErrors();$fieldCont=null;for(key in response.errors){$fieldCont=jQuery(object).find("#frm_field_"+key+"_container");if($fieldCont.length){if(!$fieldCont.is(":visible")){inCollapsedSection=
26
+ $fieldCont.closest(".frm_toggle_container");if(inCollapsedSection.length){frmTrigger=inCollapsedSection.prev();if(!frmTrigger.hasClass("frm_trigger"))frmTrigger=frmTrigger.prev(".frm_trigger");frmTrigger.trigger("click")}}if($fieldCont.is(":visible")){addFieldError($fieldCont,key,response.errors);contSubmit=false}}}jQuery(object).find(".frm-g-recaptcha, .g-recaptcha").each(function(){var $recaptcha=jQuery(this),recaptchaID=$recaptcha.data("rid");if(typeof grecaptcha!=="undefined"&&grecaptcha)if(recaptchaID)grecaptcha.reset(recaptchaID);
27
+ else grecaptcha.reset()});jQuery(document).trigger("frmFormErrors",[object,response]);fieldset.removeClass("frm_doing_ajax");scrollToFirstField(object);if(contSubmit)object.submit();else{jQuery(object).prepend(response.error_message);checkForErrorsAndMaybeSetFocus()}}else{showFileLoading(object);object.submit()}},error:function(){jQuery(object).find('input[type="submit"], input[type="button"]').prop("disabled",false);object.submit()}})}function afterFormSubmitted(object,response){var formCompleted=
28
+ jQuery(response.content).find(".frm_message");if(formCompleted.length)jQuery(document).trigger("frmFormComplete",[object,response]);else jQuery(document).trigger("frmPageChanged",[object,response])}function removeAddedScripts(formContainer,formID){var endReplace=jQuery(".frm_end_ajax_"+formID);if(endReplace.length){formContainer.nextUntil(".frm_end_ajax_"+formID).remove();endReplace.remove()}}function maybeSlideOut(oldContent,newContent){var c,newClass="frm_slideout";if(newContent.indexOf(" frm_slide")!==
29
+ -1){c=oldContent.children();if(newContent.indexOf(" frm_going_back")!==-1)newClass+=" frm_going_back";c.removeClass("frm_going_back");c.addClass(newClass);return 300}return 0}function addUrlParam(response){var url;if(history.pushState&&typeof response.page!=="undefined"){url=addQueryVar("frm_page",response.page);window.history.pushState({"html":response.html},"","?"+url)}}function addQueryVar(key,value){var kvp,i,x;key=encodeURI(key);value=encodeURI(value);kvp=document.location.search.substr(1).split("&");
30
+ i=kvp.length;while(i--){x=kvp[i].split("=");if(x[0]==key){x[1]=value;kvp[i]=x.join("=");break}}if(i<0)kvp[kvp.length]=[key,value].join("=");return kvp.join("&")}function addFieldError($fieldCont,key,jsErrors){var input,id,describedBy;if($fieldCont.length&&$fieldCont.is(":visible")){$fieldCont.addClass("frm_blank_field");input=$fieldCont.find("input, select, textarea");id="frm_error_field_"+key;describedBy=input.attr("aria-describedby");if(typeof frmThemeOverride_frmPlaceError==="function")frmThemeOverride_frmPlaceError(key,
31
+ jsErrors);else{if(-1!==jsErrors[key].indexOf("<div"))$fieldCont.append(jsErrors[key]);else $fieldCont.append('<div class="frm_error" id="'+id+'">'+jsErrors[key]+"</div>");if(typeof describedBy==="undefined")describedBy=id;else if(describedBy.indexOf(id)===-1)describedBy=describedBy+" "+id;input.attr("aria-describedby",describedBy)}input.attr("aria-invalid",true);jQuery(document).trigger("frmAddFieldError",[$fieldCont,key,jsErrors])}}function removeFieldError($fieldCont){var errorMessage=$fieldCont.find(".frm_error"),
32
+ errorId=errorMessage.attr("id"),input=$fieldCont.find("input, select, textarea"),describedBy=input.attr("aria-describedby");$fieldCont.removeClass("frm_blank_field has-error");errorMessage.remove();input.attr("aria-invalid",false);if(typeof describedBy!=="undefined"){describedBy=describedBy.replace(errorId,"");input.attr("aria-describedby",describedBy)}}function removeAllErrors(){jQuery(".form-field").removeClass("frm_blank_field has-error");jQuery(".form-field .frm_error").replaceWith("");jQuery(".frm_error_style").remove()}
33
+ function scrollToFirstField(object){var field=jQuery(object).find(".frm_blank_field").first();if(field.length)frmFrontForm.scrollMsg(field,object,true)}function showSubmitLoading($object){showLoadingIndicator($object);disableSubmitButton($object);disableSaveDraft($object)}function showLoadingIndicator($object){if(!$object.hasClass("frm_loading_form")&&!$object.hasClass("frm_loading_prev")){addLoadingClass($object);$object.trigger("frmStartFormLoading")}}function addLoadingClass($object){var loadingClass=
34
+ isGoingToPrevPage($object)?"frm_loading_prev":"frm_loading_form";$object.addClass(loadingClass)}function isGoingToPrevPage($object){return typeof frmProForm!=="undefined"&&frmProForm.goingToPreviousPage($object)}function removeSubmitLoading($object,enable,processesRunning){var loadingForm;if(processesRunning>0)return;loadingForm=jQuery(".frm_loading_form");loadingForm.removeClass("frm_loading_form");loadingForm.removeClass("frm_loading_prev");loadingForm.trigger("frmEndFormLoading");if(enable==="enable"){enableSubmitButton(loadingForm);
35
+ enableSaveDraft(loadingForm)}}function showFileLoading(object){var fileval,loading=document.getElementById("frm_loading");if(loading!==null){fileval=jQuery(object).find("input[type=file]").val();if(typeof fileval!=="undefined"&&fileval!=="")setTimeout(function(){jQuery(loading).fadeIn("slow")},2E3)}}function clearDefault(){toggleDefault(jQuery(this),"clear")}function replaceDefault(){toggleDefault(jQuery(this),"replace")}function toggleDefault($thisField,e){var thisVal,v=$thisField.data("frmval").replace(/(\n|\r\n)/g,
36
+ "\r");if(v===""||typeof v==="undefined")return false;thisVal=$thisField.val().replace(/(\n|\r\n)/g,"\r");if("replace"===e){if(thisVal==="")$thisField.addClass("frm_default").val(v)}else if(thisVal==v)$thisField.removeClass("frm_default").val("")}function resendEmail(){var $link=jQuery(this),entryId=this.getAttribute("data-eid"),formId=this.getAttribute("data-fid"),label=$link.find(".frm_link_label");if(label.length<1)label=$link;label.append('<span class="frm-wait"></span>');jQuery.ajax({type:"POST",
37
+ url:frm_js.ajax_url,data:{action:"frm_entries_send_email",entry_id:entryId,form_id:formId,nonce:frm_js.nonce},success:function(msg){var admin=document.getElementById("wpbody");if(admin===null)label.html(msg);else{label.html("");$link.after(msg)}}});return false}function confirmClick(){var message=jQuery(this).data("frmconfirm");return confirm(message)}function toggleDiv(){var div=jQuery(this).data("frmtoggle");if(jQuery(div).is(":visible"))jQuery(div).slideUp("fast");else jQuery(div).slideDown("fast");
38
+ return false}function addIndexOfFallbackForIE8(){var len,from;if(!Array.prototype.indexOf)Array.prototype.indexOf=function(elt){len=this.length>>>0;from=Number(arguments[1])||0;from=from<0?Math.ceil(from):Math.floor(from);if(from<0)from+=len;for(;from<len;from++)if(from in this&&this[from]===elt)return from;return-1}}function addTrimFallbackForIE8(){if(typeof String.prototype.trim!=="function")String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}}function addFilterFallbackForIE8(){var t,
39
+ len,res,thisp,i,val;if(!Array.prototype.filter)Array.prototype.filter=function(fun){if(this===void 0||this===null)throw new TypeError;t=Object(this);len=t.length>>>0;if(typeof fun!=="function")throw new TypeError;res=[];thisp=arguments[1];for(i=0;i<len;i++)if(i in t){val=t[i];if(fun.call(thisp,val,i,t))res.push(val)}return res}}function addKeysFallbackForIE8(){var keys,i;if(!Object.keys)Object.keys=function(obj){keys=[];for(i in obj)if(obj.hasOwnProperty(i))keys.push(i);return keys}}function onHoneypotFieldChange(){var css=
40
+ jQuery(this).css("box-shadow");if(css.match(/inset/))this.parentNode.removeChild(this)}function changeFocusWhenClickComboFieldLabel(){var label;var comboInputsContainer=document.querySelectorAll(".frm_combo_inputs_container");comboInputsContainer.forEach(function(inputsContainer){if(!inputsContainer.closest(".frm_form_field"))return;label=inputsContainer.closest(".frm_form_field").querySelector(".frm_primary_label");if(!label)return;label.addEventListener("click",function(e){inputsContainer.querySelector(".frm_form_field:first-child input, .frm_form_field:first-child select, .frm_form_field:first-child textarea").focus()})})}
41
  function checkForErrorsAndMaybeSetFocus(){var errors,element,timeoutCallback;errors=document.querySelectorAll(".frm_form_field .frm_error");if(!errors.length)return;element=errors[0];do{element=element.previousSibling;if(-1!==["input","select","textarea"].indexOf(element.nodeName.toLowerCase())){element.focus();break}if("undefined"!==typeof element.classList){if(element.classList.contains("html-active"))timeoutCallback=function(){var textarea=element.querySelector("textarea");if(null!==textarea)textarea.focus()};
42
  else if(element.classList.contains("tmce-active"))timeoutCallback=function(){tinyMCE.activeEditor.focus()};if("function"===typeof timeoutCallback){setTimeout(timeoutCallback,0);break}}}while(element.previousSibling)}return{init:function(){jQuery(document).off("submit.formidable",".frm-show-form");jQuery(document).on("submit.formidable",".frm-show-form",frmFrontForm.submitForm);jQuery(".frm-show-form input[onblur], .frm-show-form textarea[onblur]").each(function(){if(jQuery(this).val()==="")jQuery(this).trigger("blur")});
43
  jQuery(document).on("focus",".frm_toggle_default",clearDefault);jQuery(document).on("blur",".frm_toggle_default",replaceDefault);jQuery(".frm_toggle_default").trigger("blur");jQuery(document.getElementById("frm_resend_email")).on("click",resendEmail);jQuery(document).on("change",'.frm-show-form input[name^="item_meta"], .frm-show-form select[name^="item_meta"], .frm-show-form textarea[name^="item_meta"]',frmFrontForm.fieldValueChanged);jQuery(document).on("change keyup",".frm-show-form .frm_inside_container input, .frm-show-form .frm_inside_container select, .frm-show-form .frm_inside_container textarea",
js/formidable_admin.js CHANGED
@@ -6875,11 +6875,30 @@ function frmAdminBuildJS() {
6875
  }
6876
  });
6877
  } else {
 
6878
  insertContent( contentBox, variable );
6879
  }
6880
  return false;
6881
  }
6882
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6883
  function insertContent( contentBox, variable ) {
6884
  if ( document.selection ) {
6885
  contentBox[0].focus();
6875
  }
6876
  });
6877
  } else {
6878
+ variable = maybeAddSanitizeUrlToShortcodeVariable( variable, element, contentBox );
6879
  insertContent( contentBox, variable );
6880
  }
6881
  return false;
6882
  }
6883
 
6884
+ function maybeAddSanitizeUrlToShortcodeVariable( variable, element, contentBox ) {
6885
+ if ( 'object' !== typeof element || ! ( element instanceof jQuery ) || 'success_url' !== contentBox[0].id ) {
6886
+ return variable;
6887
+ }
6888
+
6889
+ element = element[0];
6890
+ if ( ! element.closest( '#frm-insert-fields-box' ) ) {
6891
+ // Only add sanitize_url=1 to field shortcodes.
6892
+ return variable;
6893
+ }
6894
+
6895
+ if ( ! element.parentNode.classList.contains( 'frm_insert_url' ) ) {
6896
+ variable = variable.replace( ']', ' sanitize_url=1]' );
6897
+ }
6898
+
6899
+ return variable;
6900
+ }
6901
+
6902
  function insertContent( contentBox, variable ) {
6903
  if ( document.selection ) {
6904
  contentBox[0].focus();
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.0.15\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: 2021-12-15T14:35:50+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"
@@ -137,7 +137,7 @@ msgstr ""
137
 
138
  #: classes/controllers/FrmAddonsController.php:26
139
  #: classes/controllers/FrmAddonsController.php:27
140
- #: classes/helpers/FrmFormsHelper.php:1339
141
  #: classes/views/frm-fields/back-end/smart-values.php:16
142
  #: classes/views/shared/admin-header.php:33
143
  msgid "Upgrade"
@@ -147,37 +147,37 @@ msgstr ""
147
  msgid "There are no plugins on your site that require a license"
148
  msgstr ""
149
 
150
- #: classes/controllers/FrmAddonsController.php:620
151
  msgid "Installed"
152
  msgstr ""
153
 
154
- #: classes/controllers/FrmAddonsController.php:625
155
  #: classes/helpers/FrmAppHelper.php:2752
156
  msgid "Active"
157
  msgstr ""
158
 
159
- #: classes/controllers/FrmAddonsController.php:630
160
  msgid "Not Installed"
161
  msgstr ""
162
 
163
- #: classes/controllers/FrmAddonsController.php:929
164
  msgid "Sorry, your site requires FTP authentication. Please download plugins from FormidableForms.com and install them manually."
165
  msgstr ""
166
 
167
- #: classes/controllers/FrmAddonsController.php:994
168
  msgid "Your plugin has been activated. Would you like to save and reload the page now?"
169
  msgstr ""
170
 
171
- #: classes/controllers/FrmAddonsController.php:998
172
  msgid "Your plugin has been activated. Please reload the page to see more options."
173
  msgstr ""
174
 
175
- #: classes/controllers/FrmAddonsController.php:1103
176
  msgid "Could not install an upgrade. Please download from formidableforms.com and install manually."
177
  msgstr ""
178
 
179
- #: classes/controllers/FrmAddonsController.php:1188
180
- #: classes/controllers/FrmAddonsController.php:1189
181
  #: classes/controllers/FrmWelcomeController.php:141
182
  #: classes/views/frm-forms/new-form-overlay.php:112
183
  #: classes/views/shared/reports-info.php:24
@@ -224,7 +224,7 @@ msgid "Build a Form"
224
  msgstr ""
225
 
226
  #: classes/controllers/FrmEntriesController.php:79
227
- #: classes/controllers/FrmFormsController.php:1335
228
  #: classes/views/frm-entries/form.php:63
229
  #: classes/views/frm-entries/sidebar-shared.php:57
230
  msgid "Entry Key"
@@ -243,7 +243,7 @@ msgid "Entry Name"
243
  msgstr ""
244
 
245
  #: classes/controllers/FrmEntriesController.php:86
246
- #: classes/helpers/FrmCSVExportHelper.php:225
247
  msgid "Created By"
248
  msgstr ""
249
 
@@ -442,7 +442,7 @@ msgstr ""
442
 
443
  #: classes/controllers/FrmFormsController.php:786
444
  #: classes/controllers/FrmFormsController.php:790
445
- #: classes/helpers/FrmCSVExportHelper.php:230
446
  #: classes/views/shared/mb_adv_info.php:98
447
  msgid "Key"
448
  msgstr ""
@@ -466,7 +466,7 @@ msgid "Date"
466
  msgstr ""
467
 
468
  #: classes/controllers/FrmFormsController.php:914
469
- #: classes/helpers/FrmFormsHelper.php:1282
470
  msgid "My Templates"
471
  msgstr ""
472
 
@@ -518,126 +518,130 @@ msgid "Styling & Buttons"
518
  msgstr ""
519
 
520
  #: classes/controllers/FrmFormsController.php:1121
 
 
 
 
521
  msgid "Customize HTML"
522
  msgstr ""
523
 
524
- #: classes/controllers/FrmFormsController.php:1251
525
  msgid "Customize field values with the following parameters."
526
  msgstr ""
527
 
528
- #: classes/controllers/FrmFormsController.php:1288
529
  msgid "Separator"
530
  msgstr ""
531
 
532
- #: classes/controllers/FrmFormsController.php:1289
533
  msgid "Use a different separator for checkbox fields"
534
  msgstr ""
535
 
536
- #: classes/controllers/FrmFormsController.php:1292
537
  msgid "Date Format"
538
  msgstr ""
539
 
540
- #: classes/controllers/FrmFormsController.php:1295
541
  #: classes/views/frm-fields/back-end/settings.php:27
542
  msgid "Field Label"
543
  msgstr ""
544
 
545
- #: classes/controllers/FrmFormsController.php:1298
546
  msgid "No Auto P"
547
  msgstr ""
548
 
549
- #: classes/controllers/FrmFormsController.php:1299
550
  msgid "Do not automatically add any paragraphs or line breaks"
551
  msgstr ""
552
 
553
- #: classes/controllers/FrmFormsController.php:1314
554
  #: classes/models/FrmField.php:62
555
  msgid "User ID"
556
  msgstr ""
557
 
558
- #: classes/controllers/FrmFormsController.php:1315
559
  msgid "First Name"
560
  msgstr ""
561
 
562
- #: classes/controllers/FrmFormsController.php:1316
563
  msgid "Last Name"
564
  msgstr ""
565
 
566
- #: classes/controllers/FrmFormsController.php:1317
567
  msgid "Display Name"
568
  msgstr ""
569
 
570
- #: classes/controllers/FrmFormsController.php:1318
571
  msgid "User Login"
572
  msgstr ""
573
 
574
- #: classes/controllers/FrmFormsController.php:1319
575
  #: classes/models/FrmField.php:34
576
  msgid "Email"
577
  msgstr ""
578
 
579
- #: classes/controllers/FrmFormsController.php:1320
580
  msgid "Avatar"
581
  msgstr ""
582
 
583
- #: classes/controllers/FrmFormsController.php:1321
584
  msgid "Author Link"
585
  msgstr ""
586
 
587
- #: classes/controllers/FrmFormsController.php:1334
588
  #: classes/views/frm-entries/sidebar-shared.php:51
589
  msgid "Entry ID"
590
  msgstr ""
591
 
592
- #: classes/controllers/FrmFormsController.php:1336
593
  msgid "Post ID"
594
  msgstr ""
595
 
596
- #: classes/controllers/FrmFormsController.php:1337
597
  msgid "User IP"
598
  msgstr ""
599
 
600
- #: classes/controllers/FrmFormsController.php:1338
601
  msgid "Entry created"
602
  msgstr ""
603
 
604
- #: classes/controllers/FrmFormsController.php:1339
605
  msgid "Entry updated"
606
  msgstr ""
607
 
608
- #: classes/controllers/FrmFormsController.php:1341
609
  msgid "Site URL"
610
  msgstr ""
611
 
612
- #: classes/controllers/FrmFormsController.php:1342
613
  msgid "Site Name"
614
  msgstr ""
615
 
616
- #: classes/controllers/FrmFormsController.php:1350
617
  msgid "Default Msg"
618
  msgstr ""
619
 
620
- #: classes/controllers/FrmFormsController.php:1351
621
  msgid "Default HTML"
622
  msgstr ""
623
 
624
- #: classes/controllers/FrmFormsController.php:1352
625
  msgid "Default Plain"
626
  msgstr ""
627
 
628
- #: classes/controllers/FrmFormsController.php:1455
629
  msgid "No forms were specified"
630
  msgstr ""
631
 
632
- #: classes/controllers/FrmFormsController.php:1567
633
  msgid "Abnormal HTML characters prevented your form from saving correctly"
634
  msgstr ""
635
 
636
- #: classes/controllers/FrmFormsController.php:1682
637
  #: classes/helpers/FrmFormsHelper.php:57
638
  #: classes/helpers/FrmFormsHelper.php:112
639
  #: classes/helpers/FrmFormsHelper.php:166
640
- #: classes/helpers/FrmFormsHelper.php:1054
641
  #: classes/helpers/FrmFormsListHelper.php:315
642
  #: classes/views/frm-forms/create-template-from-an-existing-form.php:25
643
  #: classes/views/styles/manage.php:59
@@ -646,17 +650,17 @@ msgstr ""
646
  msgid "(no title)"
647
  msgstr ""
648
 
649
- #: classes/controllers/FrmFormsController.php:1728
650
- #: classes/controllers/FrmFormsController.php:1742
651
  msgid "Please select a valid form"
652
  msgstr ""
653
 
654
- #: classes/controllers/FrmFormsController.php:1964
655
  msgid "Please wait while you are redirected."
656
  msgstr ""
657
 
658
  #. translators: %1$s: Start link HTML, %2$s: End link HTML
659
- #: classes/controllers/FrmFormsController.php:1999
660
  msgid "%1$sClick here%2$s if you are not automatically redirected."
661
  msgstr ""
662
 
@@ -952,7 +956,7 @@ msgid "Check Box & Radio Fields"
952
  msgstr ""
953
 
954
  #: classes/controllers/FrmStylesController.php:402
955
- #: classes/helpers/FrmFieldsHelper.php:1889
956
  #: classes/views/frm-forms/settings-buttons.php:46
957
  msgid "Buttons"
958
  msgstr ""
@@ -1172,7 +1176,7 @@ msgid "Remove"
1172
  msgstr ""
1173
 
1174
  #: classes/helpers/FrmAppHelper.php:2691
1175
- #: classes/helpers/FrmCSVExportHelper.php:229
1176
  #: classes/views/shared/mb_adv_info.php:95
1177
  msgid "ID"
1178
  msgstr ""
@@ -1354,7 +1358,7 @@ msgid "The parameter \"%s\" is reserved by WordPress. This may cause problems wh
1354
  msgstr ""
1355
 
1356
  #: classes/helpers/FrmAppHelper.php:2748
1357
- #: classes/helpers/FrmFormsHelper.php:1513
1358
  msgid "See the list of reserved words in WordPress."
1359
  msgstr ""
1360
 
@@ -1635,53 +1639,61 @@ msgstr ""
1635
  msgid "Vietnamese"
1636
  msgstr ""
1637
 
1638
- #: classes/helpers/FrmAppHelper.php:3239
 
 
 
 
 
 
 
 
1639
  msgid "Your account has expired"
1640
  msgstr ""
1641
 
1642
- #: classes/helpers/FrmAppHelper.php:3242
1643
  msgid "Renew Now"
1644
  msgstr ""
1645
 
1646
- #: classes/helpers/FrmCSVExportHelper.php:132
1647
  msgid "(label)"
1648
  msgstr ""
1649
 
1650
- #: classes/helpers/FrmCSVExportHelper.php:216
1651
  msgid "Comment"
1652
  msgstr ""
1653
 
1654
- #: classes/helpers/FrmCSVExportHelper.php:217
1655
  msgid "Comment User"
1656
  msgstr ""
1657
 
1658
- #: classes/helpers/FrmCSVExportHelper.php:218
1659
  msgid "Comment Date"
1660
  msgstr ""
1661
 
1662
- #: classes/helpers/FrmCSVExportHelper.php:223
1663
  msgid "Timestamp"
1664
  msgstr ""
1665
 
1666
- #: classes/helpers/FrmCSVExportHelper.php:224
1667
  msgid "Last Updated"
1668
  msgstr ""
1669
 
1670
-