Completed
Pull Request — master (#1264)
by Stephanie
42s
created
classes/controllers/FrmWelcomeController.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,8 @@
 block discarded – undo
42 42
 		}
43 43
 
44 44
 		// Only do this for single site installs.
45
-		if ( isset( $_GET['activate-multi'] ) || is_network_admin() ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
45
+		if ( isset( $_GET['activate-multi'] ) || is_network_admin() ) {
46
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
46 47
 			return;
47 48
 		}
48 49
 
Please login to merge, or discard this patch.
classes/controllers/FrmEntriesController.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -491,7 +491,8 @@
 block discarded – undo
491 491
 
492 492
 	public static function process_entry( $errors = '', $ajax = false ) {
493 493
 		$form_id = FrmAppHelper::get_post_param( 'form_id', '', 'absint' );
494
-		if ( FrmAppHelper::is_admin() || empty( $_POST ) || empty( $form_id ) || ! isset( $_POST['item_key'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
494
+		if ( FrmAppHelper::is_admin() || empty( $_POST ) || empty( $form_id ) || ! isset( $_POST['item_key'] ) ) {
495
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
495 496
 			return;
496 497
 		}
497 498
 
Please login to merge, or discard this patch.
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -75,20 +75,20 @@  discard block
 block discarded – undo
75 75
 		global $frm_vars;
76 76
 		$form_id = FrmForm::get_current_form_id();
77 77
 
78
-		$columns[ $form_id . '_id' ]       = 'ID';
79
-		$columns[ $form_id . '_item_key' ] = esc_html__( 'Entry Key', 'formidable' );
78
+		$columns[$form_id . '_id']       = 'ID';
79
+		$columns[$form_id . '_item_key'] = esc_html__( 'Entry Key', 'formidable' );
80 80
 
81 81
 		if ( $form_id ) {
82 82
 			self::get_columns_for_form( $form_id, $columns );
83 83
 		} else {
84
-			$columns[ $form_id . '_form_id' ] = __( 'Form', 'formidable' );
85
-			$columns[ $form_id . '_name' ]    = __( 'Entry Name', 'formidable' );
86
-			$columns[ $form_id . '_user_id' ] = __( 'Created By', 'formidable' );
84
+			$columns[$form_id . '_form_id'] = __( 'Form', 'formidable' );
85
+			$columns[$form_id . '_name']    = __( 'Entry Name', 'formidable' );
86
+			$columns[$form_id . '_user_id'] = __( 'Created By', 'formidable' );
87 87
 		}
88 88
 
89
-		$columns[ $form_id . '_is_draft' ]   = esc_html__( 'Entry Status', 'formidable' );
90
-		$columns[ $form_id . '_created_at' ] = __( 'Entry creation date', 'formidable' );
91
-		$columns[ $form_id . '_updated_at' ] = __( 'Entry update date', 'formidable' );
89
+		$columns[$form_id . '_is_draft']   = esc_html__( 'Entry Status', 'formidable' );
90
+		$columns[$form_id . '_created_at'] = __( 'Entry creation date', 'formidable' );
91
+		$columns[$form_id . '_updated_at'] = __( 'Entry update date', 'formidable' );
92 92
 		self::maybe_add_ip_col( $form_id, $columns );
93 93
 
94 94
 		$frm_vars['cols'] = $columns;
@@ -146,10 +146,10 @@  discard block
 block discarded – undo
146 146
 
147 147
 		foreach ( $sub_form_cols as $k => $sub_form_col ) {
148 148
 			if ( FrmField::is_no_save_field( $sub_form_col->type ) ) {
149
-				unset( $sub_form_cols[ $k ] );
149
+				unset( $sub_form_cols[$k] );
150 150
 				continue;
151 151
 			}
152
-			$columns[ $form_id . '_' . $sub_form_col->field_key . '-_-' . $field->id ] = FrmAppHelper::truncate( $sub_form_col->name, 35 );
152
+			$columns[$form_id . '_' . $sub_form_col->field_key . '-_-' . $field->id] = FrmAppHelper::truncate( $sub_form_col->name, 35 );
153 153
 			unset( $sub_form_col );
154 154
 		}
155 155
 	}
@@ -166,15 +166,15 @@  discard block
 block discarded – undo
166 166
 		$has_separate_value = ! FrmField::is_option_empty( $field, 'separate_value' );
167 167
 		$is_post_status     = FrmField::is_option_true( $field, 'post_field' ) && $field->field_options['post_field'] == 'post_status';
168 168
 		if ( $has_separate_value && ! $is_post_status ) {
169
-			$columns[ $form_id . '_frmsep_' . $col_id ] = FrmAppHelper::truncate( $field->name, 35 );
169
+			$columns[$form_id . '_frmsep_' . $col_id] = FrmAppHelper::truncate( $field->name, 35 );
170 170
 		}
171 171
 
172
-		$columns[ $form_id . '_' . $col_id ] = FrmAppHelper::truncate( $field->name, 35 );
172
+		$columns[$form_id . '_' . $col_id] = FrmAppHelper::truncate( $field->name, 35 );
173 173
 	}
174 174
 
175 175
 	private static function maybe_add_ip_col( $form_id, &$columns ) {
176 176
 		if ( FrmAppHelper::ips_saved() ) {
177
-			$columns[ $form_id . '_ip' ] = 'IP';
177
+			$columns[$form_id . '_ip'] = 'IP';
178 178
 		}
179 179
 	}
180 180
 
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 		foreach ( $meta_value as $mk => $mv ) {
213 213
 			// Remove blank values.
214 214
 			if ( empty( $mv ) ) {
215
-				unset( $meta_value[ $mk ] );
215
+				unset( $meta_value[$mk] );
216 216
 			}
217 217
 		}
218 218
 
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
 
289 289
 		foreach ( $fields as $field ) {
290 290
 			if ( self::field_supports_sorting( $field ) ) {
291
-				$columns[ $form_id . '_' . $field->field_key ] = 'meta_' . $field->id;
291
+				$columns[$form_id . '_' . $field->field_key] = 'meta_' . $field->id;
292 292
 			}
293 293
 		}
294 294
 
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
 			$atts['form_id'] . '_item_key' => '',
376 376
 			$atts['form_id'] . '_id'       => '',
377 377
 		);
378
-		$cols         = $remove_first + array_reverse( $frm_vars['cols'], true );
378
+		$cols = $remove_first + array_reverse( $frm_vars['cols'], true );
379 379
 
380 380
 		$i = $atts['i'];
381 381
 
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
 
387 387
 			if ( empty( $result ) || ! in_array( $col_key, $result, true ) ) {
388 388
 				$result[] = $col_key;
389
-				$i--;
389
+				$i --;
390 390
 			}
391 391
 
392 392
 			unset( $col_key, $col );
@@ -528,9 +528,9 @@  discard block
 block discarded – undo
528 528
 		if ( ! isset( $frm_vars['form_params'] ) ) {
529 529
 			$frm_vars['form_params'] = array();
530 530
 		}
531
-		$frm_vars['form_params'][ $form->id ] = $params;
531
+		$frm_vars['form_params'][$form->id] = $params;
532 532
 
533
-		if ( isset( $frm_vars['created_entries'][ $form_id ] ) ) {
533
+		if ( isset( $frm_vars['created_entries'][$form_id] ) ) {
534 534
 			return;
535 535
 		}
536 536
 
@@ -546,16 +546,16 @@  discard block
 block discarded – undo
546 546
 		 */
547 547
 		$errors = apply_filters( 'frm_entries_before_create', $errors, $form );
548 548
 
549
-		$frm_vars['created_entries'][ $form_id ] = array( 'errors' => $errors );
549
+		$frm_vars['created_entries'][$form_id] = array( 'errors' => $errors );
550 550
 
551 551
 		if ( empty( $errors ) ) {
552 552
 			$_POST['frm_skip_cookie'] = 1;
553 553
 			$do_success               = false;
554 554
 			if ( $params['action'] === 'create' ) {
555
-				if ( apply_filters( 'frm_continue_to_create', true, $form_id ) && ! isset( $frm_vars['created_entries'][ $form_id ]['entry_id'] ) ) {
556
-					$frm_vars['created_entries'][ $form_id ]['entry_id'] = FrmEntry::create( $_POST ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
555
+				if ( apply_filters( 'frm_continue_to_create', true, $form_id ) && ! isset( $frm_vars['created_entries'][$form_id]['entry_id'] ) ) {
556
+					$frm_vars['created_entries'][$form_id]['entry_id'] = FrmEntry::create( $_POST ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
557 557
 
558
-					$params['id'] = $frm_vars['created_entries'][ $form_id ]['entry_id'];
558
+					$params['id'] = $frm_vars['created_entries'][$form_id]['entry_id'];
559 559
 					$do_success   = true;
560 560
 				}
561 561
 			}
Please login to merge, or discard this patch.
classes/models/fields/FrmFieldUserID.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@
 block discarded – undo
52 52
 	protected function get_field_value( $args ) {
53 53
 		$user_ID      = get_current_user_id();
54 54
 		$user_ID      = ( $user_ID ? $user_ID : '' );
55
-		$posted_value = ( FrmAppHelper::is_admin() && $_POST && isset( $_POST['item_meta'][ $this->field['id'] ] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
55
+		$posted_value = ( FrmAppHelper::is_admin() && $_POST && isset( $_POST['item_meta'][$this->field['id']] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
56 56
 		$action       = ( isset( $args['action'] ) ? $args['action'] : ( isset( $args['form_action'] ) ? $args['form_action'] : '' ) );
57 57
 		$updating     = $action == 'update';
58 58
 		return ( is_numeric( $this->field['value'] ) || $posted_value || $updating ) ? $this->field['value'] : $user_ID;
Please login to merge, or discard this patch.
classes/helpers/FrmFieldsHelper.php 2 patches
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -180,7 +180,8 @@  discard block
 block discarded – undo
180 180
 	 * @param mixed $value
181 181
 	 */
182 182
 	private static function get_posted_field_setting( $setting, &$value ) {
183
-		if ( ! isset( $_POST['field_options'][ $setting ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
183
+		if ( ! isset( $_POST['field_options'][ $setting ] ) ) {
184
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
184 185
 			return;
185 186
 		}
186 187
 
@@ -1084,7 +1085,8 @@  discard block
 block discarded – undo
1084 1085
 
1085 1086
 		// Check posted vals before checking saved values
1086 1087
 		// For fields inside repeating sections - note, don't check if $pointer is true because it will often be zero
1087
-		if ( $parent && isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
1088
+		if ( $parent && isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) ) {
1089
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
1088 1090
 			if ( FrmField::is_field_with_multiple_values( $field ) ) {
1089 1091
 				// phpcs:ignore WordPress.Security.NonceVerification.Missing
1090 1092
 				$other_val = isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ][ $opt_key ] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ][ $opt_key ] ) ) : '';
@@ -1094,7 +1096,8 @@  discard block
 block discarded – undo
1094 1096
 
1095 1097
 			return $other_val;
1096 1098
 
1097
-		} elseif ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][ $field['id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
1099
+		} elseif ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][ $field['id'] ] ) ) {
1100
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
1098 1101
 			// For normal fields
1099 1102
 
1100 1103
 			if ( FrmField::is_field_with_multiple_values( $field ) ) {
Please login to merge, or discard this patch.
Spacing   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 			if ( in_array( $type, array( 'data', 'lookup' ) ) ) {
27 27
 				$values['field_options']['data_type'] = $setting;
28 28
 			} else {
29
-				$values['field_options'][ $setting ] = 1;
29
+				$values['field_options'][$setting] = 1;
30 30
 			}
31 31
 		}
32 32
 
@@ -133,10 +133,10 @@  discard block
 block discarded – undo
133 133
 		}
134 134
 
135 135
 		foreach ( $defaults as $opt => $default ) {
136
-			$values[ $opt ] = isset( $field->field_options[ $opt ] ) ? $field->field_options[ $opt ] : $default;
136
+			$values[$opt] = isset( $field->field_options[$opt] ) ? $field->field_options[$opt] : $default;
137 137
 
138 138
 			if ( $check_post ) {
139
-				self::get_posted_field_setting( $opt . '_' . $field->id, $values[ $opt ] );
139
+				self::get_posted_field_setting( $opt . '_' . $field->id, $values[$opt] );
140 140
 			}
141 141
 
142 142
 			unset( $opt, $default );
@@ -180,18 +180,18 @@  discard block
 block discarded – undo
180 180
 	 * @param mixed $value
181 181
 	 */
182 182
 	private static function get_posted_field_setting( $setting, &$value ) {
183
-		if ( ! isset( $_POST['field_options'][ $setting ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
183
+		if ( ! isset( $_POST['field_options'][$setting] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
184 184
 			return;
185 185
 		}
186 186
 
187 187
 		if ( strpos( $setting, 'html' ) !== false ) {
188 188
 			// Strip slashes from HTML but not regex or script tags.
189
-			$value = wp_unslash( $_POST['field_options'][ $setting ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
189
+			$value = wp_unslash( $_POST['field_options'][$setting] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
190 190
 		} elseif ( strpos( $setting, 'format_' ) === 0 ) {
191 191
 			// TODO: Remove stripslashes on output, and use on input only.
192
-			$value = sanitize_text_field( $_POST['field_options'][ $setting ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.NonceVerification.Missing
192
+			$value = sanitize_text_field( $_POST['field_options'][$setting] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.NonceVerification.Missing
193 193
 		} else {
194
-			$value = wp_unslash( $_POST['field_options'][ $setting ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
194
+			$value = wp_unslash( $_POST['field_options'][$setting] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
195 195
 			FrmAppHelper::sanitize_value( 'wp_kses_post', $value );
196 196
 		}
197 197
 	}
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
 		$values['default_value'] = FrmAppHelper::maybe_json_encode( $field->default_value );
265 265
 
266 266
 		foreach ( array( 'name', 'description', 'type', 'field_order', 'field_options', 'required' ) as $col ) {
267
-			$values[ $col ] = $field->{$col};
267
+			$values[$col] = $field->{$col};
268 268
 		}
269 269
 	}
270 270
 
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
 		);
305 305
 
306 306
 		$msg = FrmField::get_option( $field, $error );
307
-		$msg = empty( $msg ) ? $defaults[ $error ]['part'] : $msg;
307
+		$msg = empty( $msg ) ? $defaults[$error]['part'] : $msg;
308 308
 		$msg = do_shortcode( $msg );
309 309
 
310 310
 		return $msg;
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
 		}
415 415
 
416 416
 		$base_name = 'default_value_' . $field['id'];
417
-		$html_id    = isset( $field['html_id'] ) ? $field['html_id'] : self::get_html_id( $field );
417
+		$html_id = isset( $field['html_id'] ) ? $field['html_id'] : self::get_html_id( $field );
418 418
 
419 419
 		$default_type = self::get_default_value_type( $field );
420 420
 
@@ -738,7 +738,7 @@  discard block
 block discarded – undo
738 738
 				continue;
739 739
 			}
740 740
 
741
-			$atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[3][ $short_key ] );
741
+			$atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[3][$short_key] );
742 742
 			$tag  = FrmShortcodeHelper::get_shortcode_tag( $shortcodes, $short_key );
743 743
 
744 744
 			$atts['entry'] = $entry;
@@ -748,7 +748,7 @@  discard block
 block discarded – undo
748 748
 			if ( $replace_with !== null ) {
749 749
 				$replace_with = self::trigger_shortcode_atts( $replace_with, $atts );
750 750
 				self::sanitize_embedded_shortcodes( compact( 'entry' ), $replace_with );
751
-				$content = str_replace( $shortcodes[0][ $short_key ], $replace_with, $content );
751
+				$content = str_replace( $shortcodes[0][$short_key], $replace_with, $content );
752 752
 			}
753 753
 
754 754
 			unset( $atts, $replace_with );
@@ -766,7 +766,7 @@  discard block
 block discarded – undo
766 766
 		$supported_atts = array( 'remove_accents', 'sanitize', 'sanitize_url' );
767 767
 		$included_atts  = array_intersect( $supported_atts, array_keys( $atts ) );
768 768
 		foreach ( $included_atts as $included_att ) {
769
-			if ( '0' === $atts[ $included_att ] ) {
769
+			if ( '0' === $atts[$included_att] ) {
770 770
 				// Skip any option that uses 0 so sanitize_url=0 does not encode.
771 771
 				continue;
772 772
 			}
@@ -839,8 +839,8 @@  discard block
 block discarded – undo
839 839
 
840 840
 		$dynamic_default = array( 'admin_email', 'siteurl', 'frmurl', 'sitename', 'get' );
841 841
 
842
-		if ( isset( $shortcode_values[ $atts['tag'] ] ) ) {
843
-			$replace_with = $shortcode_values[ $atts['tag'] ];
842
+		if ( isset( $shortcode_values[$atts['tag']] ) ) {
843
+			$replace_with = $shortcode_values[$atts['tag']];
844 844
 		} elseif ( in_array( $atts['tag'], $dynamic_default ) ) {
845 845
 			$replace_with = self::dynamic_default_values( $atts['tag'], $atts );
846 846
 		} elseif ( $clean_tag == 'user_agent' ) {
@@ -1051,8 +1051,8 @@  discard block
 block discarded – undo
1051 1051
 			self::field_types_for_input( $single_input, $field_selection, $field_types );
1052 1052
 		} elseif ( in_array( $type, $multiple_input ) ) {
1053 1053
 			self::field_types_for_input( $multiple_input, $field_selection, $field_types );
1054
-		} elseif ( isset( $field_selection[ $type ] ) ) {
1055
-			$field_types[ $type ] = $field_selection[ $type ];
1054
+		} elseif ( isset( $field_selection[$type] ) ) {
1055
+			$field_types[$type] = $field_selection[$type];
1056 1056
 		}
1057 1057
 
1058 1058
 		$field_types = apply_filters( 'frm_switch_field_types', $field_types, compact( 'type', 'field_selection' ) );
@@ -1085,7 +1085,7 @@  discard block
 block discarded – undo
1085 1085
 
1086 1086
 	private static function field_types_for_input( $inputs, $fields, &$field_types ) {
1087 1087
 		foreach ( $inputs as $input ) {
1088
-			$field_types[ $input ] = $fields[ $input ];
1088
+			$field_types[$input] = $fields[$input];
1089 1089
 			unset( $input );
1090 1090
 		}
1091 1091
 	}
@@ -1117,7 +1117,7 @@  discard block
 block discarded – undo
1117 1117
 			'parent'  => false,
1118 1118
 			'pointer' => false,
1119 1119
 		);
1120
-		$args     = wp_parse_args( $args, $defaults );
1120
+		$args = wp_parse_args( $args, $defaults );
1121 1121
 
1122 1122
 		$opt_key   = $args['opt_key'];
1123 1123
 		$field     = $args['field'];
@@ -1133,24 +1133,24 @@  discard block
 block discarded – undo
1133 1133
 
1134 1134
 		// Check posted vals before checking saved values
1135 1135
 		// For fields inside repeating sections - note, don't check if $pointer is true because it will often be zero
1136
-		if ( $parent && isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
1136
+		if ( $parent && isset( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
1137 1137
 			if ( FrmField::is_field_with_multiple_values( $field ) ) {
1138 1138
 				// phpcs:ignore WordPress.Security.NonceVerification.Missing
1139
-				$other_val = isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ][ $opt_key ] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ][ $opt_key ] ) ) : '';
1139
+				$other_val = isset( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']][$opt_key] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']][$opt_key] ) ) : '';
1140 1140
 			} else {
1141
-				$other_val = sanitize_text_field( wp_unslash( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
1141
+				$other_val = sanitize_text_field( wp_unslash( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
1142 1142
 			}
1143 1143
 
1144 1144
 			return $other_val;
1145 1145
 
1146
-		} elseif ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][ $field['id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
1146
+		} elseif ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][$field['id']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
1147 1147
 			// For normal fields
1148 1148
 
1149 1149
 			if ( FrmField::is_field_with_multiple_values( $field ) ) {
1150 1150
 				// phpcs:ignore WordPress.Security.NonceVerification.Missing
1151
-				$other_val = isset( $_POST['item_meta']['other'][ $field['id'] ][ $opt_key ] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][ $field['id'] ][ $opt_key ] ) ) : '';
1151
+				$other_val = isset( $_POST['item_meta']['other'][$field['id']][$opt_key] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][$field['id']][$opt_key] ) ) : '';
1152 1152
 			} else {
1153
-				$other_val = sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][ $field['id'] ] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
1153
+				$other_val = sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][$field['id']] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
1154 1154
 			}
1155 1155
 
1156 1156
 			return $other_val;
@@ -1160,8 +1160,8 @@  discard block
 block discarded – undo
1160 1160
 		if ( $field['type'] === 'checkbox' && is_array( $field['value'] ) ) {
1161 1161
 			// Check if there is an "other" val in saved value and make sure the
1162 1162
 			// "other" val is not equal to the Other checkbox option
1163
-			if ( isset( $field['value'][ $opt_key ] ) && $field['options'][ $opt_key ] != $field['value'][ $opt_key ] ) {
1164
-				$other_val = $field['value'][ $opt_key ];
1163
+			if ( isset( $field['value'][$opt_key] ) && $field['options'][$opt_key] != $field['value'][$opt_key] ) {
1164
+				$other_val = $field['value'][$opt_key];
1165 1165
 			}
1166 1166
 		} else {
1167 1167
 			/**
@@ -1173,8 +1173,8 @@  discard block
 block discarded – undo
1173 1173
 				// Multi-select dropdowns - key is not preserved
1174 1174
 				if ( is_array( $field['value'] ) ) {
1175 1175
 					$o_key = array_search( $temp_val, $field['value'] );
1176
-					if ( isset( $field['value'][ $o_key ] ) ) {
1177
-						unset( $field['value'][ $o_key ], $o_key );
1176
+					if ( isset( $field['value'][$o_key] ) ) {
1177
+						unset( $field['value'][$o_key], $o_key );
1178 1178
 					}
1179 1179
 				} elseif ( $temp_val == $field['value'] ) {
1180 1180
 					// For radio and regular dropdowns
@@ -1216,7 +1216,7 @@  discard block
 block discarded – undo
1216 1216
 			return $other_args;
1217 1217
 		}
1218 1218
 
1219
-		$other_opt  = true;
1219
+		$other_opt = true;
1220 1220
 
1221 1221
 		self::set_other_name( $args, $other_args );
1222 1222
 		self::set_other_value( $args, $other_args );
@@ -1374,7 +1374,7 @@  discard block
 block discarded – undo
1374 1374
 		if ( is_array( $val ) ) {
1375 1375
 			foreach ( $val as $k => $v ) {
1376 1376
 				if ( is_string( $v ) ) {
1377
-					$val[ $k ] = str_replace( $replace, $replace_with, $v );
1377
+					$val[$k] = str_replace( $replace, $replace_with, $v );
1378 1378
 					unset( $k, $v );
1379 1379
 				}
1380 1380
 			}
@@ -1727,7 +1727,7 @@  discard block
 block discarded – undo
1727 1727
 			$countries['class'] = 'frm-countries-opts';
1728 1728
 		}
1729 1729
 
1730
-		$prepop[ __( 'Countries', 'formidable' ) ] = $countries;
1730
+		$prepop[__( 'Countries', 'formidable' )] = $countries;
1731 1731
 
1732 1732
 		// State abv.
1733 1733
 		$states    = self::get_us_states();
@@ -1737,7 +1737,7 @@  discard block
 block discarded – undo
1737 1737
 			$state_abv['class'] = 'frm-state-abv-opts';
1738 1738
 		}
1739 1739
 
1740
-		$prepop[ __( 'U.S. State Abbreviations', 'formidable' ) ] = $state_abv;
1740
+		$prepop[__( 'U.S. State Abbreviations', 'formidable' )] = $state_abv;
1741 1741
 
1742 1742
 		// States.
1743 1743
 		$states = array_values( $states );
@@ -1746,7 +1746,7 @@  discard block
 block discarded – undo
1746 1746
 			$states['class'] = 'frm-states-opts';
1747 1747
 		}
1748 1748
 
1749
-		$prepop[ __( 'U.S. States', 'formidable' ) ] = $states;
1749
+		$prepop[__( 'U.S. States', 'formidable' )] = $states;
1750 1750
 		unset( $state_abv, $states );
1751 1751
 
1752 1752
 		// Age.
@@ -1764,7 +1764,7 @@  discard block
 block discarded – undo
1764 1764
 			$ages['class'] = 'frm-age-opts';
1765 1765
 		}
1766 1766
 
1767
-		$prepop[ __( 'Age', 'formidable' ) ] = $ages;
1767
+		$prepop[__( 'Age', 'formidable' )] = $ages;
1768 1768
 
1769 1769
 		// Satisfaction.
1770 1770
 		$satisfaction = array(
@@ -1779,7 +1779,7 @@  discard block
 block discarded – undo
1779 1779
 			$satisfaction['class'] = 'frm-satisfaction-opts';
1780 1780
 		}
1781 1781
 
1782
-		$prepop[ __( 'Satisfaction', 'formidable' ) ] = $satisfaction;
1782
+		$prepop[__( 'Satisfaction', 'formidable' )] = $satisfaction;
1783 1783
 
1784 1784
 		// Importance.
1785 1785
 		$importance = array(
@@ -1794,7 +1794,7 @@  discard block
 block discarded – undo
1794 1794
 			$importance['class'] = 'frm-importance-opts';
1795 1795
 		}
1796 1796
 
1797
-		$prepop[ __( 'Importance', 'formidable' ) ] = $importance;
1797
+		$prepop[__( 'Importance', 'formidable' )] = $importance;
1798 1798
 
1799 1799
 		// Agreement.
1800 1800
 		$agreement = array(
@@ -1809,7 +1809,7 @@  discard block
 block discarded – undo
1809 1809
 			$agreement['class'] = 'frm-agreement-opts';
1810 1810
 		}
1811 1811
 
1812
-		$prepop[ __( 'Agreement', 'formidable' ) ] = $agreement;
1812
+		$prepop[__( 'Agreement', 'formidable' )] = $agreement;
1813 1813
 
1814 1814
 		// Likely.
1815 1815
 		$likely = array(
@@ -1824,7 +1824,7 @@  discard block
 block discarded – undo
1824 1824
 			$likely['class'] = 'frm-likely-opts';
1825 1825
 		}
1826 1826
 
1827
-		$prepop[ __( 'Likely', 'formidable' ) ] = $likely;
1827
+		$prepop[__( 'Likely', 'formidable' )] = $likely;
1828 1828
 
1829 1829
 		$prepop = apply_filters( 'frm_bulk_field_choices', $prepop );
1830 1830
 	}
@@ -2015,16 +2015,16 @@  discard block
 block discarded – undo
2015 2015
 	 */
2016 2016
 	private static function fill_image_setting_options( $options, &$args ) {
2017 2017
 		foreach ( $options as $key => $option ) {
2018
-			$args['options'][ $key ] = $option;
2018
+			$args['options'][$key] = $option;
2019 2019
 
2020 2020
 			if ( ! empty( $option['addon'] ) ) {
2021
-				$args['options'][ $key ]['custom_attrs'] = self::fill_image_setting_addon_link( $option );
2021
+				$args['options'][$key]['custom_attrs'] = self::fill_image_setting_addon_link( $option );
2022 2022
 			}
2023 2023
 
2024
-			unset( $args['options'][ $key ]['addon'] );
2024
+			unset( $args['options'][$key]['addon'] );
2025 2025
 			$fill = array( 'upgrade', 'message', 'content' );
2026 2026
 			foreach ( $fill as $f ) {
2027
-				unset( $args['options'][ $key ][ $f ], $f );
2027
+				unset( $args['options'][$key][$f], $f );
2028 2028
 			}
2029 2029
 		}
2030 2030
 	}
@@ -2045,8 +2045,8 @@  discard block
 block discarded – undo
2045 2045
 
2046 2046
 		$fill = array( 'upgrade', 'message', 'content' );
2047 2047
 		foreach ( $fill as $f ) {
2048
-			if ( isset( $option[ $f ] ) ) {
2049
-				$custom_attrs[ 'data-' . $f ] = $option[ $f ];
2048
+			if ( isset( $option[$f] ) ) {
2049
+				$custom_attrs['data-' . $f] = $option[$f];
2050 2050
 			}
2051 2051
 		}
2052 2052
 
Please login to merge, or discard this patch.
classes/helpers/FrmListHelper.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -235,8 +235,8 @@  discard block
 block discarded – undo
235 235
 			return $this->get_pagenum();
236 236
 		}
237 237
 
238
-		if ( isset( $this->_pagination_args[ $key ] ) ) {
239
-			return $this->_pagination_args[ $key ];
238
+		if ( isset( $this->_pagination_args[$key] ) ) {
239
+			return $this->_pagination_args[$key];
240 240
 		}
241 241
 	}
242 242
 
@@ -284,8 +284,8 @@  discard block
 block discarded – undo
284 284
 	}
285 285
 
286 286
 	private function hidden_search_inputs( $param_name ) {
287
-		if ( ! empty( $_REQUEST[ $param_name ] ) ) {
288
-			$value = sanitize_text_field( wp_unslash( $_REQUEST[ $param_name ] ) );
287
+		if ( ! empty( $_REQUEST[$param_name] ) ) {
288
+			$value = sanitize_text_field( wp_unslash( $_REQUEST[$param_name] ) );
289 289
 			echo '<input type="hidden" name="' . esc_attr( $param_name ) . '" value="' . esc_attr( $value ) . '" />';
290 290
 		}
291 291
 	}
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
 
330 330
 		echo "<ul class='subsubsub'>\n";
331 331
 		foreach ( $views as $class => $view ) {
332
-			$views[ $class ] = "\t" . '<li class="' . esc_attr( $class ) . '">' . $view;
332
+			$views[$class] = "\t" . '<li class="' . esc_attr( $class ) . '">' . $view;
333 333
 		}
334 334
 		echo implode( " |</li>\n", $views ) . "</li>\n"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
335 335
 		echo '</ul>';
@@ -702,7 +702,7 @@  discard block
 block discarded – undo
702 702
 			'next'  => __( 'Next page', 'formidable' ),
703 703
 		);
704 704
 
705
-		return $labels[ $link ];
705
+		return $labels[$link];
706 706
 	}
707 707
 
708 708
 	private function current_url() {
@@ -795,7 +795,7 @@  discard block
 block discarded – undo
795 795
 
796 796
 		// If the primary column doesn't exist fall back to the
797 797
 		// first non-checkbox column.
798
-		if ( ! isset( $columns[ $default ] ) ) {
798
+		if ( ! isset( $columns[$default] ) ) {
799 799
 			$default = self::get_default_primary_column_name();
800 800
 		}
801 801
 
@@ -809,7 +809,7 @@  discard block
 block discarded – undo
809 809
 		 */
810 810
 		$column = apply_filters( 'list_table_primary_column', $default, $this->screen->id );
811 811
 
812
-		if ( empty( $column ) || ! isset( $columns[ $column ] ) ) {
812
+		if ( empty( $column ) || ! isset( $columns[$column] ) ) {
813 813
 			$column = $default;
814 814
 		}
815 815
 
@@ -831,7 +831,7 @@  discard block
 block discarded – undo
831 831
 			// In 4.3, we added a fourth argument for primary column.
832 832
 			$column_headers = array( array(), array(), array(), $this->get_primary_column_name() );
833 833
 			foreach ( $this->_column_headers as $key => $value ) {
834
-				$column_headers[ $key ] = $value;
834
+				$column_headers[$key] = $value;
835 835
 			}
836 836
 
837 837
 			return $column_headers;
@@ -864,7 +864,7 @@  discard block
 block discarded – undo
864 864
 				$data[1] = false;
865 865
 			}
866 866
 
867
-			$sortable[ $id ] = $data;
867
+			$sortable[$id] = $data;
868 868
 		}
869 869
 
870 870
 		$primary = $this->get_primary_column_name();
@@ -941,8 +941,8 @@  discard block
 block discarded – undo
941 941
 				$class[] = 'column-primary';
942 942
 			}
943 943
 
944
-			if ( isset( $sortable[ $column_key ] ) ) {
945
-				list( $orderby, $desc_first ) = $sortable[ $column_key ];
944
+			if ( isset( $sortable[$column_key] ) ) {
945
+				list( $orderby, $desc_first ) = $sortable[$column_key];
946 946
 
947 947
 				if ( $current_orderby == $orderby ) {
948 948
 					$order   = 'asc' == $current_order ? 'desc' : 'asc';
Please login to merge, or discard this patch.
classes/helpers/FrmEntriesHelper.php 2 patches
Braces   +14 added lines, -7 removed lines patch added patch discarded remove patch
@@ -114,13 +114,16 @@  discard block
 block discarded – undo
114 114
 	 */
115 115
 	public static function value_is_posted( $field, $args ) {
116 116
 		$value_is_posted = false;
117
-		if ( $_POST ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
117
+		if ( $_POST ) {
118
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
118 119
 			$repeating = isset( $args['repeating'] ) && $args['repeating'];
119 120
 			if ( $repeating ) {
120
-				if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
121
+				if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field->id ] ) ) {
122
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
121 123
 					$value_is_posted = true;
122 124
 				}
123
-			} elseif ( isset( $_POST['item_meta'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
125
+			} elseif ( isset( $_POST['item_meta'][ $field->id ] ) ) {
126
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
124 127
 				$value_is_posted = true;
125 128
 			}
126 129
 		}
@@ -322,8 +325,10 @@  discard block
 block discarded – undo
322 325
 	 * @since 4.01
323 326
 	 */
324 327
 	private static function set_parent_field_posted_value( $field, $value, $args ) {
325
-		if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ] ) && is_array( $_POST['item_meta'][ $args['parent_field_id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
326
-			if ( ! isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) || ! is_array( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
328
+		if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ] ) && is_array( $_POST['item_meta'][ $args['parent_field_id'] ] ) ) {
329
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
330
+			if ( ! isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) || ! is_array( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) ) {
331
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
327 332
 				$_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing
328 333
 			}
329 334
 		} else {
@@ -395,7 +400,8 @@  discard block
 block discarded – undo
395 400
 		self::set_other_repeating_vals( $field, $value, $args );
396 401
 
397 402
 		// Check if there are any posted "Other" values.
398
-		if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
403
+		if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][ $field->id ] ) ) {
404
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
399 405
 
400 406
 			// Save original value.
401 407
 			$args['temp_value'] = $value;
@@ -425,7 +431,8 @@  discard block
 block discarded – undo
425 431
 		}
426 432
 
427 433
 		// Check if there are any other posted "other" values for this field.
428
-		if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ]['other'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
434
+		if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ]['other'][ $field->id ] ) ) {
435
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
429 436
 			// Save original value
430 437
 			$args['temp_value'] = $value;
431 438
 			$args['other']      = true;
Please login to merge, or discard this patch.
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -137,10 +137,10 @@  discard block
 block discarded – undo
137 137
 		if ( $_POST ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
138 138
 			$repeating = isset( $args['repeating'] ) && $args['repeating'];
139 139
 			if ( $repeating ) {
140
-				if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
140
+				if ( isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
141 141
 					$value_is_posted = true;
142 142
 				}
143
-			} elseif ( isset( $_POST['item_meta'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
143
+			} elseif ( isset( $_POST['item_meta'][$field->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
144 144
 				$value_is_posted = true;
145 145
 			}
146 146
 		}
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 		preg_match_all( "/\[(default-message|default_message)\b(.*?)(?:(\/))?\]/s", $message, $shortcodes, PREG_PATTERN_ORDER );
173 173
 
174 174
 		foreach ( $shortcodes[0] as $short_key => $tag ) {
175
-			$add_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][ $short_key ] );
175
+			$add_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][$short_key] );
176 176
 			if ( ! empty( $add_atts ) ) {
177 177
 				$this_atts = array_merge( $atts, $add_atts );
178 178
 			} else {
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 			$default = FrmEntriesController::show_entry_shortcode( $this_atts );
183 183
 
184 184
 			// Add the default message.
185
-			$message = str_replace( $shortcodes[0][ $short_key ], $default, $message );
185
+			$message = str_replace( $shortcodes[0][$short_key], $default, $message );
186 186
 		}
187 187
 
188 188
 		return $message;
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
 	 * @return string
196 196
 	 */
197 197
 	public static function prepare_display_value( $entry, $field, $atts ) {
198
-		$field_value = isset( $entry->metas[ $field->id ] ) ? $entry->metas[ $field->id ] : false;
198
+		$field_value = isset( $entry->metas[$field->id] ) ? $entry->metas[$field->id] : false;
199 199
 
200 200
 		if ( FrmAppHelper::pro_is_installed() ) {
201 201
 			$empty = empty( $field_value );
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 			$child_entries = FrmEntry::getAll( array( 'it.parent_item_id' => $entry->id ), '', '', true );
221 221
 		} else {
222 222
 			// Get all values for this field.
223
-			$child_values = isset( $entry->metas[ $atts['embedded_field_id'] ] ) ? $entry->metas[ $atts['embedded_field_id'] ] : false;
223
+			$child_values = isset( $entry->metas[$atts['embedded_field_id']] ) ? $entry->metas[$atts['embedded_field_id']] : false;
224 224
 
225 225
 			if ( $child_values ) {
226 226
 				$child_entries = FrmEntry::getAll( array( 'it.id' => (array) $child_values ) );
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
 			$value = $args['temp_value'];
339 339
 		}
340 340
 		if ( empty( $args['parent_field_id'] ) ) {
341
-			$_POST['item_meta'][ $field->id ] = $value;
341
+			$_POST['item_meta'][$field->id] = $value;
342 342
 		} else {
343 343
 			self::set_parent_field_posted_value( $field, $value, $args );
344 344
 		}
@@ -350,17 +350,17 @@  discard block
 block discarded – undo
350 350
 	 * @since 4.01
351 351
 	 */
352 352
 	private static function set_parent_field_posted_value( $field, $value, $args ) {
353
-		if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ] ) && is_array( $_POST['item_meta'][ $args['parent_field_id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
354
-			if ( ! isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) || ! is_array( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
355
-				$_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing
353
+		if ( isset( $_POST['item_meta'][$args['parent_field_id']] ) && is_array( $_POST['item_meta'][$args['parent_field_id']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
354
+			if ( ! isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] ) || ! is_array( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
355
+				$_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing
356 356
 			}
357 357
 		} else {
358 358
 			// All of the section was probably removed.
359
-			$_POST['item_meta'][ $args['parent_field_id'] ]                         = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing
360
-			$_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing
359
+			$_POST['item_meta'][$args['parent_field_id']]                         = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing
360
+			$_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing
361 361
 		}
362 362
 
363
-		$_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field->id ] = $value; // phpcs:ignore WordPress.Security.NonceVerification.Missing
363
+		$_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field->id] = $value; // phpcs:ignore WordPress.Security.NonceVerification.Missing
364 364
 	}
365 365
 
366 366
 	public static function get_posted_value( $field, &$value, $args ) {
@@ -390,9 +390,9 @@  discard block
 block discarded – undo
390 390
 	private static function get_posted_meta( $field_id, $args ) {
391 391
 		if ( empty( $args['parent_field_id'] ) ) {
392 392
 			// Sanitizing is done next.
393
-			$value = isset( $_POST['item_meta'][ $field_id ] ) ? wp_unslash( $_POST['item_meta'][ $field_id ] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
393
+			$value = isset( $_POST['item_meta'][$field_id] ) ? wp_unslash( $_POST['item_meta'][$field_id] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
394 394
 		} else {
395
-			$value = isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field_id ] ) ? wp_unslash( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field_id ] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
395
+			$value = isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field_id] ) ? wp_unslash( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field_id] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
396 396
 		}
397 397
 		return $value;
398 398
 	}
@@ -423,14 +423,14 @@  discard block
 block discarded – undo
423 423
 		self::set_other_repeating_vals( $field, $value, $args );
424 424
 
425 425
 		// Check if there are any posted "Other" values.
426
-		if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
426
+		if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][$field->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
427 427
 
428 428
 			// Save original value.
429 429
 			$args['temp_value'] = $value;
430 430
 			$args['other']      = true;
431 431
 
432 432
 			// Sanitizing is done next.
433
-			$other_vals = wp_unslash( $_POST['item_meta']['other'][ $field->id ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
433
+			$other_vals = wp_unslash( $_POST['item_meta']['other'][$field->id] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
434 434
 			FrmAppHelper::sanitize_value( 'sanitize_text_field', $other_vals );
435 435
 
436 436
 			// Set the validation value now
@@ -453,12 +453,12 @@  discard block
 block discarded – undo
453 453
 		}
454 454
 
455 455
 		// Check if there are any other posted "other" values for this field.
456
-		if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ]['other'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
456
+		if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']]['other'][$field->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
457 457
 			// Save original value
458 458
 			$args['temp_value'] = $value;
459 459
 			$args['other']      = true;
460 460
 
461
-			$other_vals = wp_unslash( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ]['other'][ $field->id ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
461
+			$other_vals = wp_unslash( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']]['other'][$field->id] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
462 462
 			FrmAppHelper::sanitize_value( 'sanitize_text_field', $other_vals );
463 463
 
464 464
 			// Set the validation value now.
@@ -485,7 +485,7 @@  discard block
 block discarded – undo
485 485
 		if ( is_array( $value ) && $field->type === 'checkbox' ) {
486 486
 			// Combine "Other" values with checked values. "Other" values will override checked box values.
487 487
 			foreach ( $other_vals as $k => $v ) {
488
-				if ( isset( $value[ $k ] ) && trim( $v ) === '' ) {
488
+				if ( isset( $value[$k] ) && trim( $v ) === '' ) {
489 489
 					// If the other box is checked, but doesn't have a value.
490 490
 					$value = '';
491 491
 					break;
@@ -502,25 +502,25 @@  discard block
 block discarded – undo
502 502
 
503 503
 			// Multi-select dropdown.
504 504
 			if ( is_array( $value ) ) {
505
-				$o_key = array_search( $field->options[ $other_key ], $value );
505
+				$o_key = array_search( $field->options[$other_key], $value );
506 506
 
507 507
 				if ( $o_key !== false ) {
508 508
 					// Modify the original value so other key will be preserved.
509
-					$value[ $other_key ] = $value[ $o_key ];
509
+					$value[$other_key] = $value[$o_key];
510 510
 
511 511
 					// By default, the array keys will be numeric for multi-select dropdowns.
512 512
 					// If going backwards and forwards between pages, the array key will match the other key.
513 513
 					if ( $o_key !== $other_key ) {
514
-						unset( $value[ $o_key ] );
514
+						unset( $value[$o_key] );
515 515
 					}
516 516
 
517 517
 					$args['temp_value']  = $value;
518
-					$value[ $other_key ] = reset( $other_vals );
519
-					if ( FrmAppHelper::is_empty_value( $value[ $other_key ] ) ) {
520
-						unset( $value[ $other_key ] );
518
+					$value[$other_key] = reset( $other_vals );
519
+					if ( FrmAppHelper::is_empty_value( $value[$other_key] ) ) {
520
+						unset( $value[$other_key] );
521 521
 					}
522 522
 				}
523
-			} elseif ( $field->options[ $other_key ] == $value ) {
523
+			} elseif ( $field->options[$other_key] == $value ) {
524 524
 				$value = $other_vals;
525 525
 			}
526 526
 		}
@@ -731,7 +731,7 @@  discard block
 block discarded – undo
731 731
 	 * @return void
732 732
 	 */
733 733
 	public static function maybe_render_captcha_score( $entry_id ) {
734
-		$query                 = array(
734
+		$query = array(
735 735
 			'item_id'  => (int) $entry_id,
736 736
 			'field_id' => 0,
737 737
 		);
@@ -784,7 +784,7 @@  discard block
 block discarded – undo
784 784
 	public static function get_entry_status_label( $status ) {
785 785
 		$statuses = self::get_entry_statuses();
786 786
 
787
-		return $statuses[ self::get_entry_status( $status ) ];
787
+		return $statuses[self::get_entry_status( $status )];
788 788
 	}
789 789
 
790 790
 	/**
Please login to merge, or discard this patch.
classes/helpers/FrmAppHelper.php 2 patches
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -412,7 +412,8 @@  discard block
 block discarded – undo
412 412
 
413 413
 		if ( $src === 'get' ) {
414 414
 			$value = isset( $_POST[ $param ] ) ? wp_unslash( $_POST[ $param ] ) : ( isset( $_GET[ $param ] ) ? wp_unslash( $_GET[ $param ] ) : $default ); // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
415
-			if ( ! isset( $_POST[ $param ] ) && isset( $_GET[ $param ] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
415
+			if ( ! isset( $_POST[ $param ] ) && isset( $_GET[ $param ] ) && ! is_array( $value ) ) {
416
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
416 417
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
417 418
 				$value = htmlspecialchars_decode( wp_unslash( $_GET[ $param ] ) );
418 419
 			}
@@ -500,7 +501,8 @@  discard block
 block discarded – undo
500 501
 				$value = wp_unslash( $_GET[ $args['param'] ] );
501 502
 			}
502 503
 		} elseif ( $args['type'] == 'post' ) {
503
-			if ( isset( $_POST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
504
+			if ( isset( $_POST[ $args['param'] ] ) ) {
505
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
504 506
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
505 507
 				$value = wp_unslash( $_POST[ $args['param'] ] );
506 508
 				if ( $args['serialized'] === true && is_serialized_string( $value ) && is_serialized( $value ) ) {
@@ -508,7 +510,8 @@  discard block
 block discarded – undo
508 510
 				}
509 511
 			}
510 512
 		} else {
511
-			if ( isset( $_REQUEST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
513
+			if ( isset( $_REQUEST[ $args['param'] ] ) ) {
514
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
512 515
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
513 516
 				$value = wp_unslash( $_REQUEST[ $args['param'] ] );
514 517
 			}
Please login to merge, or discard this patch.
Spacing   +77 added lines, -77 removed lines patch added patch discarded remove patch
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 			'fill'   => '#4d4d4d',
163 163
 			'orange' => '#f05a24',
164 164
 		);
165
-		$atts     = array_merge( $defaults, $atts );
165
+		$atts = array_merge( $defaults, $atts );
166 166
 
167 167
 		return '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 599.68 601.37" width="' . esc_attr( $atts['width'] ) . '" height="' . esc_attr( $atts['height'] ) . '">
168 168
 			<path fill="' . esc_attr( $atts['orange'] ) . '" d="M289.6 384h140v76h-140z"/>
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
 	 * @return string
374 374
 	 */
375 375
 	public static function get_server_value( $value ) {
376
-		return isset( $_SERVER[ $value ] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[ $value ] ) ) : '';
376
+		return isset( $_SERVER[$value] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[$value] ) ) : '';
377 377
 	}
378 378
 
379 379
 	/**
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
 		$ip         = '';
388 388
 
389 389
 		foreach ( $ip_options as $key ) {
390
-			if ( ! isset( $_SERVER[ $key ] ) ) {
390
+			if ( ! isset( $_SERVER[$key] ) ) {
391 391
 				continue;
392 392
 			}
393 393
 
@@ -455,10 +455,10 @@  discard block
 block discarded – undo
455 455
 		}
456 456
 
457 457
 		if ( $src === 'get' ) {
458
-			$value = isset( $_POST[ $param ] ) ? wp_unslash( $_POST[ $param ] ) : ( isset( $_GET[ $param ] ) ? wp_unslash( $_GET[ $param ] ) : $default ); // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
459
-			if ( ! isset( $_POST[ $param ] ) && isset( $_GET[ $param ] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
458
+			$value = isset( $_POST[$param] ) ? wp_unslash( $_POST[$param] ) : ( isset( $_GET[$param] ) ? wp_unslash( $_GET[$param] ) : $default ); // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
459
+			if ( ! isset( $_POST[$param] ) && isset( $_GET[$param] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
460 460
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
461
-				$value = htmlspecialchars_decode( wp_unslash( $_GET[ $param ] ) );
461
+				$value = htmlspecialchars_decode( wp_unslash( $_GET[$param] ) );
462 462
 			}
463 463
 			self::sanitize_value( $sanitize, $value );
464 464
 		} else {
@@ -479,7 +479,7 @@  discard block
 block discarded – undo
479 479
 				}
480 480
 
481 481
 				$p     = trim( $p, ']' );
482
-				$value = isset( $value[ $p ] ) ? $value[ $p ] : $default;
482
+				$value = isset( $value[$p] ) ? $value[$p] : $default;
483 483
 			}
484 484
 		}
485 485
 
@@ -535,26 +535,26 @@  discard block
 block discarded – undo
535 535
 			'sanitize' => 'sanitize_text_field',
536 536
 			'serialized' => false,
537 537
 		);
538
-		$args     = wp_parse_args( $args, $defaults );
538
+		$args = wp_parse_args( $args, $defaults );
539 539
 
540 540
 		$value = $args['default'];
541 541
 		if ( $args['type'] == 'get' ) {
542
-			if ( $_GET && isset( $_GET[ $args['param'] ] ) ) {
542
+			if ( $_GET && isset( $_GET[$args['param']] ) ) {
543 543
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
544
-				$value = wp_unslash( $_GET[ $args['param'] ] );
544
+				$value = wp_unslash( $_GET[$args['param']] );
545 545
 			}
546 546
 		} elseif ( $args['type'] == 'post' ) {
547
-			if ( isset( $_POST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
547
+			if ( isset( $_POST[$args['param']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
548 548
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
549
-				$value = wp_unslash( $_POST[ $args['param'] ] );
549
+				$value = wp_unslash( $_POST[$args['param']] );
550 550
 				if ( $args['serialized'] === true && is_serialized_string( $value ) && is_serialized( $value ) ) {
551 551
 					self::unserialize_or_decode( $value );
552 552
 				}
553 553
 			}
554 554
 		} else {
555
-			if ( isset( $_REQUEST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
555
+			if ( isset( $_REQUEST[$args['param']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
556 556
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
557
-				$value = wp_unslash( $_REQUEST[ $args['param'] ] );
557
+				$value = wp_unslash( $_REQUEST[$args['param']] );
558 558
 			}
559 559
 		}
560 560
 
@@ -586,7 +586,7 @@  discard block
 block discarded – undo
586 586
 			if ( is_array( $value ) ) {
587 587
 				$temp_values = $value;
588 588
 				foreach ( $temp_values as $k => $v ) {
589
-					self::sanitize_value( $sanitize, $value[ $k ] );
589
+					self::sanitize_value( $sanitize, $value[$k] );
590 590
 				}
591 591
 			} else {
592 592
 				$value = call_user_func( $sanitize, $value );
@@ -597,8 +597,8 @@  discard block
 block discarded – undo
597 597
 	public static function sanitize_request( $sanitize_method, &$values ) {
598 598
 		$temp_values = $values;
599 599
 		foreach ( $temp_values as $k => $val ) {
600
-			if ( isset( $sanitize_method[ $k ] ) ) {
601
-				$values[ $k ] = call_user_func( $sanitize_method[ $k ], $val );
600
+			if ( isset( $sanitize_method[$k] ) ) {
601
+				$values[$k] = call_user_func( $sanitize_method[$k], $val );
602 602
 			}
603 603
 		}
604 604
 	}
@@ -621,7 +621,7 @@  discard block
 block discarded – undo
621 621
 		if ( is_array( $value ) ) {
622 622
 			$temp_values = $value;
623 623
 			foreach ( $temp_values as $k => $v ) {
624
-				self::decode_specialchars( $value[ $k ] );
624
+				self::decode_specialchars( $value[$k] );
625 625
 			}
626 626
 		} else {
627 627
 			self::decode_amp( $value );
@@ -741,7 +741,7 @@  discard block
 block discarded – undo
741 741
 	 * @return array
742 742
 	 */
743 743
 	public static function add_allowed_submit_button_tags( $allowed_html ) {
744
-		$allowed_html['input']                    = array(
744
+		$allowed_html['input'] = array(
745 745
 			'type'           => true,
746 746
 			'value'          => true,
747 747
 			'formnovalidate' => true,
@@ -764,7 +764,7 @@  discard block
 block discarded – undo
764 764
 			$allowed_html = $html;
765 765
 		} elseif ( ! empty( $allowed ) ) {
766 766
 			foreach ( (array) $allowed as $a ) {
767
-				$allowed_html[ $a ] = isset( $html[ $a ] ) ? $html[ $a ] : array();
767
+				$allowed_html[$a] = isset( $html[$a] ) ? $html[$a] : array();
768 768
 			}
769 769
 		}
770 770
 
@@ -943,8 +943,8 @@  discard block
 block discarded – undo
943 943
 		}
944 944
 
945 945
 		global $wp_query;
946
-		if ( isset( $wp_query->query_vars[ $param ] ) ) {
947
-			$value = $wp_query->query_vars[ $param ];
946
+		if ( isset( $wp_query->query_vars[$param] ) ) {
947
+			$value = $wp_query->query_vars[$param];
948 948
 		}
949 949
 
950 950
 		return $value;
@@ -971,9 +971,9 @@  discard block
 block discarded – undo
971 971
 		$deprecated = array(
972 972
 			'frm_clone_solid_icon' => 'frm_clone_icon',
973 973
 		);
974
-		if ( isset( $deprecated[ $icon ] ) ) {
975
-			$icon = $deprecated[ $icon ];
976
-			$class = str_replace( $icon, $deprecated[ $icon ], $class );
974
+		if ( isset( $deprecated[$icon] ) ) {
975
+			$icon = $deprecated[$icon];
976
+			$class = str_replace( $icon, $deprecated[$icon], $class );
977 977
 		}
978 978
 
979 979
 		if ( $icon === $class ) {
@@ -1298,7 +1298,7 @@  discard block
 block discarded – undo
1298 1298
 				'new_file_path' => self::plugin_path() . '/js',
1299 1299
 			)
1300 1300
 		);
1301
-		$new_file  = new FrmCreateFile( $file_atts );
1301
+		$new_file = new FrmCreateFile( $file_atts );
1302 1302
 
1303 1303
 		$files = array(
1304 1304
 			self::plugin_path() . '/js/formidable.min.js',
@@ -1779,8 +1779,8 @@  discard block
 block discarded – undo
1779 1779
 			return $error;
1780 1780
 		}
1781 1781
 
1782
-		$nonce_value = ( $_REQUEST && isset( $_REQUEST[ $nonce_name ] ) ) ? sanitize_text_field( wp_unslash( $_REQUEST[ $nonce_name ] ) ) : '';
1783
-		if ( $_REQUEST && ( ! isset( $_REQUEST[ $nonce_name ] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) {
1782
+		$nonce_value = ( $_REQUEST && isset( $_REQUEST[$nonce_name] ) ) ? sanitize_text_field( wp_unslash( $_REQUEST[$nonce_name] ) ) : '';
1783
+		if ( $_REQUEST && ( ! isset( $_REQUEST[$nonce_name] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) {
1784 1784
 			$frm_settings = self::get_settings();
1785 1785
 			$error        = $frm_settings->admin_permission;
1786 1786
 		}
@@ -1815,7 +1815,7 @@  discard block
 block discarded – undo
1815 1815
 			} else {
1816 1816
 				foreach ( $value as $k => $v ) {
1817 1817
 					if ( ! is_array( $v ) ) {
1818
-						$value[ $k ] = call_user_func( $original_function, $v );
1818
+						$value[$k] = call_user_func( $original_function, $v );
1819 1819
 					}
1820 1820
 				}
1821 1821
 			}
@@ -1840,7 +1840,7 @@  discard block
 block discarded – undo
1840 1840
 				$return = array_merge( $return, self::array_flatten( $value, $keys ) );
1841 1841
 			} else {
1842 1842
 				if ( $keys == 'keep' ) {
1843
-					$return[ $key ] = $value;
1843
+					$return[$key] = $value;
1844 1844
 				} else {
1845 1845
 					$return[] = $value;
1846 1846
 				}
@@ -1893,11 +1893,11 @@  discard block
 block discarded – undo
1893 1893
 		}
1894 1894
 
1895 1895
 		$ver = $default;
1896
-		if ( ! isset( $wp_scripts->registered[ $handle ] ) ) {
1896
+		if ( ! isset( $wp_scripts->registered[$handle] ) ) {
1897 1897
 			return $ver;
1898 1898
 		}
1899 1899
 
1900
-		$query = $wp_scripts->registered[ $handle ];
1900
+		$query = $wp_scripts->registered[$handle];
1901 1901
 		if ( is_object( $query ) && ! empty( $query->ver ) ) {
1902 1902
 			$ver = $query->ver;
1903 1903
 		}
@@ -2003,7 +2003,7 @@  discard block
 block discarded – undo
2003 2003
 			$suffix = 2;
2004 2004
 			do {
2005 2005
 				$key_check = $key . $separator . $suffix;
2006
-				++$suffix;
2006
+				++ $suffix;
2007 2007
 			} while ( in_array( $key_check, $similar_keys, true ) );
2008 2008
 
2009 2009
 			$key = $key_check;
@@ -2104,7 +2104,7 @@  discard block
 block discarded – undo
2104 2104
 
2105 2105
 		foreach ( array( 'name', 'description' ) as $var ) {
2106 2106
 			$default_val    = isset( $record->{$var} ) ? $record->{$var} : '';
2107
-			$values[ $var ] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' );
2107
+			$values[$var] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' );
2108 2108
 			unset( $var, $default_val );
2109 2109
 		}
2110 2110
 
@@ -2162,9 +2162,9 @@  discard block
 block discarded – undo
2162 2162
 			}
2163 2163
 		}
2164 2164
 
2165
-		$field_type = isset( $post_values['field_options'][ 'type_' . $field->id ] ) ? $post_values['field_options'][ 'type_' . $field->id ] : $field->type;
2166
-		if ( isset( $post_values['item_meta'][ $field->id ] ) ) {
2167
-			$new_value = $post_values['item_meta'][ $field->id ];
2165
+		$field_type = isset( $post_values['field_options']['type_' . $field->id] ) ? $post_values['field_options']['type_' . $field->id] : $field->type;
2166
+		if ( isset( $post_values['item_meta'][$field->id] ) ) {
2167
+			$new_value = $post_values['item_meta'][$field->id];
2168 2168
 			self::unserialize_or_decode( $new_value );
2169 2169
 		} else {
2170 2170
 			$new_value = $meta_value;
@@ -2185,7 +2185,7 @@  discard block
 block discarded – undo
2185 2185
 
2186 2186
 		$field_array = array_merge( (array) $field->field_options, $field_array );
2187 2187
 
2188
-		$values['fields'][ $field->id ] = $field_array;
2188
+		$values['fields'][$field->id] = $field_array;
2189 2189
 	}
2190 2190
 
2191 2191
 	/**
@@ -2232,11 +2232,11 @@  discard block
 block discarded – undo
2232 2232
 		}
2233 2233
 
2234 2234
 		foreach ( $form->options as $opt => $value ) {
2235
-			if ( isset( $post_values[ $opt ] ) ) {
2236
-				$values[ $opt ] = $post_values[ $opt ];
2237
-				self::unserialize_or_decode( $values[ $opt ] );
2235
+			if ( isset( $post_values[$opt] ) ) {
2236
+				$values[$opt] = $post_values[$opt];
2237
+				self::unserialize_or_decode( $values[$opt] );
2238 2238
 			} else {
2239
-				$values[ $opt ] = $value;
2239
+				$values[$opt] = $value;
2240 2240
 			}
2241 2241
 		}
2242 2242
 
@@ -2250,8 +2250,8 @@  discard block
 block discarded – undo
2250 2250
 		$form_defaults = FrmFormsHelper::get_default_opts();
2251 2251
 
2252 2252
 		foreach ( $form_defaults as $opt => $default ) {
2253
-			if ( ! isset( $values[ $opt ] ) || $values[ $opt ] == '' ) {
2254
-				$values[ $opt ] = ( $post_values && isset( $post_values['options'][ $opt ] ) ) ? $post_values['options'][ $opt ] : $default;
2253
+			if ( ! isset( $values[$opt] ) || $values[$opt] == '' ) {
2254
+				$values[$opt] = ( $post_values && isset( $post_values['options'][$opt] ) ) ? $post_values['options'][$opt] : $default;
2255 2255
 			}
2256 2256
 
2257 2257
 			unset( $opt, $default );
@@ -2262,8 +2262,8 @@  discard block
 block discarded – undo
2262 2262
 		}
2263 2263
 
2264 2264
 		foreach ( array( 'before', 'after', 'submit' ) as $h ) {
2265
-			if ( ! isset( $values[ $h . '_html' ] ) ) {
2266
-				$values[ $h . '_html' ] = ( isset( $post_values['options'][ $h . '_html' ] ) ? $post_values['options'][ $h . '_html' ] : FrmFormsHelper::get_default_html( $h ) );
2265
+			if ( ! isset( $values[$h . '_html'] ) ) {
2266
+				$values[$h . '_html'] = ( isset( $post_values['options'][$h . '_html'] ) ? $post_values['options'][$h . '_html'] : FrmFormsHelper::get_default_html( $h ) );
2267 2267
 			}
2268 2268
 			unset( $h );
2269 2269
 		}
@@ -2415,25 +2415,25 @@  discard block
 block discarded – undo
2415 2415
 		if ( ! is_numeric( $levels ) ) {
2416 2416
 			// Show time in specified unit.
2417 2417
 			$levels = self::get_unit( $levels );
2418
-			if ( isset( $time_strings[ $levels ] ) ) {
2418
+			if ( isset( $time_strings[$levels] ) ) {
2419 2419
 				$diff = array(
2420 2420
 					$levels => self::time_format( $levels, $diff ),
2421 2421
 				);
2422 2422
 				$time_strings = array(
2423
-					$levels => $time_strings[ $levels ],
2423
+					$levels => $time_strings[$levels],
2424 2424
 				);
2425 2425
 			}
2426 2426
 			$levels = 1;
2427 2427
 		}
2428 2428
 
2429 2429
 		foreach ( $time_strings as $k => $v ) {
2430
-			if ( isset( $diff[ $k ] ) && $diff[ $k ] ) {
2431
-				$time_strings[ $k ] = $diff[ $k ] . ' ' . ( $diff[ $k ] > 1 ? $v[1] : $v[0] );
2432
-			} elseif ( isset( $diff[ $k ] ) && count( $time_strings ) === 1 ) {
2430
+			if ( isset( $diff[$k] ) && $diff[$k] ) {
2431
+				$time_strings[$k] = $diff[$k] . ' ' . ( $diff[$k] > 1 ? $v[1] : $v[0] );
2432
+			} elseif ( isset( $diff[$k] ) && count( $time_strings ) === 1 ) {
2433 2433
 				// Account for 0.
2434
-				$time_strings[ $k ] = $diff[ $k ] . ' ' . $v[1];
2434
+				$time_strings[$k] = $diff[$k] . ' ' . $v[1];
2435 2435
 			} else {
2436
-				unset( $time_strings[ $k ] );
2436
+				unset( $time_strings[$k] );
2437 2437
 			}
2438 2438
 		}
2439 2439
 
@@ -2452,8 +2452,8 @@  discard block
 block discarded – undo
2452 2452
 			'y' => 'y',
2453 2453
 			'd' => 'days',
2454 2454
 		);
2455
-		if ( isset( $return[ $unit ] ) ) {
2456
-			return $diff[ $return[ $unit ] ];
2455
+		if ( isset( $return[$unit] ) ) {
2456
+			return $diff[$return[$unit]];
2457 2457
 		}
2458 2458
 
2459 2459
 		$total = $diff['days'] * self::convert_time( 'd', $unit );
@@ -2461,11 +2461,11 @@  discard block
 block discarded – undo
2461 2461
 		$times = array( 'h', 'i', 's' );
2462 2462
 
2463 2463
 		foreach ( $times as $time ) {
2464
-			if ( ! isset( $diff[ $time ] ) ) {
2464
+			if ( ! isset( $diff[$time] ) ) {
2465 2465
 				continue;
2466 2466
 			}
2467 2467
 
2468
-			$total += $diff[ $time ] * self::convert_time( $time, $unit );
2468
+			$total += $diff[$time] * self::convert_time( $time, $unit );
2469 2469
 		}
2470 2470
 
2471 2471
 		return floor( $total );
@@ -2485,7 +2485,7 @@  discard block
 block discarded – undo
2485 2485
 			'y' => DAY_IN_SECONDS * 365.25,
2486 2486
 		);
2487 2487
 
2488
-		return $convert[ $from ] / $convert[ $to ];
2488
+		return $convert[$from] / $convert[$to];
2489 2489
 	}
2490 2490
 
2491 2491
 	/**
@@ -2493,7 +2493,7 @@  discard block
 block discarded – undo
2493 2493
 	 */
2494 2494
 	private static function get_unit( $unit ) {
2495 2495
 		$units = self::get_time_strings();
2496
-		if ( isset( $units[ $unit ] ) || is_numeric( $unit ) ) {
2496
+		if ( isset( $units[$unit] ) || is_numeric( $unit ) ) {
2497 2497
 			return $unit;
2498 2498
 		}
2499 2499
 
@@ -2604,17 +2604,17 @@  discard block
 block discarded – undo
2604 2604
 
2605 2605
 					case 1:
2606 2606
 						$l2 = $name;
2607
-						self::add_value_to_array( $name, $l2, $this_val, $vars[ $l1 ] );
2607
+						self::add_value_to_array( $name, $l2, $this_val, $vars[$l1] );
2608 2608
 						break;
2609 2609
 
2610 2610
 					case 2:
2611 2611
 						$l3 = $name;
2612
-						self::add_value_to_array( $name, $l3, $this_val, $vars[ $l1 ][ $l2 ] );
2612
+						self::add_value_to_array( $name, $l3, $this_val, $vars[$l1][$l2] );
2613 2613
 						break;
2614 2614
 
2615 2615
 					case 3:
2616 2616
 						$l4 = $name;
2617
-						self::add_value_to_array( $name, $l4, $this_val, $vars[ $l1 ][ $l2 ][ $l3 ] );
2617
+						self::add_value_to_array( $name, $l4, $this_val, $vars[$l1][$l2][$l3] );
2618 2618
 				}
2619 2619
 
2620 2620
 				unset( $this_val, $n );
@@ -2633,8 +2633,8 @@  discard block
 block discarded – undo
2633 2633
 	public static function add_value_to_array( $name, $l1, $val, &$vars ) {
2634 2634
 		if ( $name == '' ) {
2635 2635
 			$vars[] = $val;
2636
-		} elseif ( ! isset( $vars[ $l1 ] ) ) {
2637
-			$vars[ $l1 ] = $val;
2636
+		} elseif ( ! isset( $vars[$l1] ) ) {
2637
+			$vars[$l1] = $val;
2638 2638
 		}
2639 2639
 	}
2640 2640
 
@@ -2651,7 +2651,7 @@  discard block
 block discarded – undo
2651 2651
 			'new_tab'       => __( 'This option will open the link in a new browser tab. Please note that some popup blockers may prevent this from happening, in which case the link will be displayed.', 'formidable' ),
2652 2652
 		);
2653 2653
 
2654
-		if ( ! isset( $tooltips[ $name ] ) ) {
2654
+		if ( ! isset( $tooltips[$name] ) ) {
2655 2655
 			return;
2656 2656
 		}
2657 2657
 
@@ -2661,7 +2661,7 @@  discard block
 block discarded – undo
2661 2661
 			echo ' class="frm_help"';
2662 2662
 		}
2663 2663
 
2664
-		echo ' title="' . esc_attr( $tooltips[ $name ] );
2664
+		echo ' title="' . esc_attr( $tooltips[$name] );
2665 2665
 
2666 2666
 		if ( 'open' != $class ) {
2667 2667
 			echo '"';
@@ -2720,13 +2720,13 @@  discard block
 block discarded – undo
2720 2720
 	}
2721 2721
 
2722 2722
 	private static function prepare_action_slashes( $val, $key, &$post_content ) {
2723
-		if ( ! isset( $post_content[ $key ] ) || is_numeric( $val ) ) {
2723
+		if ( ! isset( $post_content[$key] ) || is_numeric( $val ) ) {
2724 2724
 			return;
2725 2725
 		}
2726 2726
 
2727 2727
 		if ( is_array( $val ) ) {
2728 2728
 			foreach ( $val as $k1 => $v1 ) {
2729
-				self::prepare_action_slashes( $v1, $k1, $post_content[ $key ] );
2729
+				self::prepare_action_slashes( $v1, $k1, $post_content[$key] );
2730 2730
 				unset( $k1, $v1 );
2731 2731
 			}
2732 2732
 		} else {
@@ -2734,7 +2734,7 @@  discard block
 block discarded – undo
2734 2734
 			$val = stripslashes( $val );
2735 2735
 
2736 2736
 			// Add backslashes before double quotes and forward slashes only
2737
-			$post_content[ $key ] = addcslashes( $val, '"\\/' );
2737
+			$post_content[$key] = addcslashes( $val, '"\\/' );
2738 2738
 		}
2739 2739
 	}
2740 2740
 
@@ -2855,14 +2855,14 @@  discard block
 block discarded – undo
2855 2855
 				continue;
2856 2856
 			}
2857 2857
 			$key = $input['name'];
2858
-			if ( isset( $formatted[ $key ] ) ) {
2859
-				if ( is_array( $formatted[ $key ] ) ) {
2860
-					$formatted[ $key ][] = $input['value'];
2858
+			if ( isset( $formatted[$key] ) ) {
2859
+				if ( is_array( $formatted[$key] ) ) {
2860
+					$formatted[$key][] = $input['value'];
2861 2861
 				} else {
2862
-					$formatted[ $key ] = array( $formatted[ $key ], $input['value'] );
2862
+					$formatted[$key] = array( $formatted[$key], $input['value'] );
2863 2863
 				}
2864 2864
 			} else {
2865
-				$formatted[ $key ] = $input['value'];
2865
+				$formatted[$key] = $input['value'];
2866 2866
 			}
2867 2867
 		}
2868 2868
 
@@ -3524,8 +3524,8 @@  discard block
 block discarded – undo
3524 3524
 		}
3525 3525
 
3526 3526
 		foreach ( $keys as $key ) {
3527
-			if ( isset( $values[ $key ] ) ) {
3528
-				$values[ $key ] = self::kses( $values[ $key ], 'all' );
3527
+			if ( isset( $values[$key] ) ) {
3528
+				$values[$key] = self::kses( $values[$key], 'all' );
3529 3529
 			}
3530 3530
 		}
3531 3531
 
@@ -3684,7 +3684,7 @@  discard block
 block discarded – undo
3684 3684
 			return 0;
3685 3685
 		}
3686 3686
 
3687
-		return strlen( $parts[ count( $parts ) - 1 ] );
3687
+		return strlen( $parts[count( $parts ) - 1] );
3688 3688
 	}
3689 3689
 
3690 3690
 	/**
Please login to merge, or discard this patch.
deprecated/FrmEDD_SL_Plugin_Updater.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 		$this->beta        = ! empty( $this->api_data['beta'] ) ? true : false;
45 45
 		$this->cache_key   = md5( serialize( $this->slug . $this->version . $this->api_data['license'] . $this->beta ) );
46 46
 
47
-		$frm_edd_plugin_data[ $this->slug ] = $this->api_data;
47
+		$frm_edd_plugin_data[$this->slug] = $this->api_data;
48 48
 
49 49
 		/**
50 50
 		 * Fires after the $frm_edd_plugin_data is setup.
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 			$_transient_data = new stdClass();
94 94
 		}
95 95
 
96
-		if ( ! empty( $_transient_data->response ) && ! empty( $_transient_data->response[ $this->name ] ) && false === $this->wp_override ) {
96
+		if ( ! empty( $_transient_data->response ) && ! empty( $_transient_data->response[$this->name] ) && false === $this->wp_override ) {
97 97
 			return $_transient_data;
98 98
 		}
99 99
 
@@ -120,12 +120,12 @@  discard block
 block discarded – undo
120 120
 					$version_info->plugin = $this->name;
121 121
 				}
122 122
 
123
-				$_transient_data->response[ $this->name ] = $version_info;
123
+				$_transient_data->response[$this->name] = $version_info;
124 124
 
125 125
 			}
126 126
 
127 127
 			$_transient_data->last_checked           = time();
128
-			$_transient_data->checked[ $this->name ] = $this->version;
128
+			$_transient_data->checked[$this->name] = $this->version;
129 129
 
130 130
 		}
131 131
 
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 		if ( isset( $_data->sections ) && ! is_array( $_data->sections ) ) {
190 190
 			$new_sections = array();
191 191
 			foreach ( $_data->sections as $key => $value ) {
192
-				$new_sections[ $key ] = $value;
192
+				$new_sections[$key] = $value;
193 193
 			}
194 194
 
195 195
 			$_data->sections = $new_sections;
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
 		if ( isset( $_data->banners ) && ! is_array( $_data->banners ) ) {
200 200
 			$new_banners = array();
201 201
 			foreach ( $_data->banners as $key => $value ) {
202
-				$new_banners[ $key ] = $value;
202
+				$new_banners[$key] = $value;
203 203
 			}
204 204
 
205 205
 			$_data->banners = $new_banners;
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
 		}
317 317
 
318 318
 		$slug         = sanitize_text_field( $_REQUEST['slug'] ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
319
-		$data         = $frm_edd_plugin_data[ $slug ];
319
+		$data         = $frm_edd_plugin_data[$slug];
320 320
 		$beta         = ! empty( $data['beta'] ) ? true : false;
321 321
 		$cache_key    = md5( 'edd_plugin_' . sanitize_key( $_REQUEST['plugin'] ) . '_' . $beta . '_version_info' ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
322 322
 		$version_info = $this->get_cached_version_info( $cache_key );
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -303,11 +303,13 @@
 block discarded – undo
303 303
 
304 304
 		global $frm_edd_plugin_data;
305 305
 
306
-		if ( empty( $_REQUEST['edd_sl_action'] ) || 'view_plugin_changelog' !== $_REQUEST['edd_sl_action'] ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
306
+		if ( empty( $_REQUEST['edd_sl_action'] ) || 'view_plugin_changelog' !== $_REQUEST['edd_sl_action'] ) {
307
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
307 308
 			return;
308 309
 		}
309 310
 
310
-		if ( empty( $_REQUEST['plugin'] ) || empty( $_REQUEST['slug'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
311
+		if ( empty( $_REQUEST['plugin'] ) || empty( $_REQUEST['slug'] ) ) {
312
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
311 313
 			return;
312 314
 		}
313 315
 
Please login to merge, or discard this patch.
classes/views/solutions/_import.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 				$info['url'] = $xml;
12 12
 			}
13 13
 
14
-			$disabled = isset( $imported[ $info['form'] ] ) ? ' disabled' : '';
14
+			$disabled = isset( $imported[$info['form']] ) ? ' disabled' : '';
15 15
 			$url   = isset( $info['url'] ) ? $info['url'] : '';
16 16
 			$value = $importing === 'form' ? $info['form'] : $info['key'];
17 17
 			if ( ! isset( $info['img'] ) ) {
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 				continue;
22 22
 			}
23 23
 
24
-			$hide_views = $importing === 'view' && ( ( $selected && $info['form'] !== $selected ) || isset( $imported[ $info['form'] ] ) );
24
+			$hide_views = $importing === 'view' && ( ( $selected && $info['form'] !== $selected ) || isset( $imported[$info['form']] ) );
25 25
 			?>
26 26
 			<div class="frm_radio radio-inline radio frm_image_option<?php echo esc_attr( $importing === 'view' ? ' show_sub_opt show_' . $info['form'] : '' ); ?>" style="<?php echo esc_attr( $hide_views ? 'display:none' : '' ); ?>">
27 27
 				<?php if ( $importing === 'form' ) { ?>
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 					<?php } ?>
42 42
 					/>
43 43
 					<div class="frm_image_option_container frm_label_with_image">
44
-						<?php echo FrmAppHelper::kses( $info['img'], array( 'svg', 'rect', 'path' ) );  // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
44
+						<?php echo FrmAppHelper::kses( $info['img'], array( 'svg', 'rect', 'path' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
45 45
 						<span class="frm_text_label_for_image">
46 46
 							<?php
47 47
 							if ( ! empty( $disabled ) ) {
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 							}
55 55
 
56 56
 							if ( $importing === 'form' && $disabled ) {
57
-								echo FrmAppHelper::kses( FrmFormsHelper::edit_form_link( $imported[ $info['form'] ] ), array( 'a' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
57
+								echo FrmAppHelper::kses( FrmFormsHelper::edit_form_link( $imported[$info['form']] ), array( 'a' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
58 58
 							} else {
59 59
 								echo esc_html( $info['name'] );
60 60
 							}
Please login to merge, or discard this patch.