Completed
Pull Request — master (#651)
by Stephanie
54s
created
classes/helpers/FrmFieldsHelper.php 2 patches
Spacing   +44 added lines, -44 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;
@@ -747,7 +747,7 @@  discard block
 block discarded – undo
747 747
 
748 748
 			if ( $replace_with !== null ) {
749 749
 				self::sanitize_embedded_shortcodes( compact( 'entry' ), $replace_with );
750
-				$content = str_replace( $shortcodes[0][ $short_key ], $replace_with, $content );
750
+				$content = str_replace( $shortcodes[0][$short_key], $replace_with, $content );
751 751
 			}
752 752
 
753 753
 			unset( $atts, $replace_with );
@@ -790,8 +790,8 @@  discard block
 block discarded – undo
790 790
 
791 791
 		$dynamic_default = array( 'admin_email', 'siteurl', 'frmurl', 'sitename', 'get' );
792 792
 
793
-		if ( isset( $shortcode_values[ $atts['tag'] ] ) ) {
794
-			$replace_with = $shortcode_values[ $atts['tag'] ];
793
+		if ( isset( $shortcode_values[$atts['tag']] ) ) {
794
+			$replace_with = $shortcode_values[$atts['tag']];
795 795
 		} elseif ( in_array( $atts['tag'], $dynamic_default ) ) {
796 796
 			$replace_with = self::dynamic_default_values( $atts['tag'], $atts );
797 797
 		} elseif ( $clean_tag == 'user_agent' ) {
@@ -1002,8 +1002,8 @@  discard block
 block discarded – undo
1002 1002
 			self::field_types_for_input( $single_input, $field_selection, $field_types );
1003 1003
 		} elseif ( in_array( $type, $multiple_input ) ) {
1004 1004
 			self::field_types_for_input( $multiple_input, $field_selection, $field_types );
1005
-		} elseif ( isset( $field_selection[ $type ] ) ) {
1006
-			$field_types[ $type ] = $field_selection[ $type ];
1005
+		} elseif ( isset( $field_selection[$type] ) ) {
1006
+			$field_types[$type] = $field_selection[$type];
1007 1007
 		}
1008 1008
 
1009 1009
 		$field_types = apply_filters( 'frm_switch_field_types', $field_types, compact( 'type', 'field_selection' ) );
@@ -1036,7 +1036,7 @@  discard block
 block discarded – undo
1036 1036
 
1037 1037
 	private static function field_types_for_input( $inputs, $fields, &$field_types ) {
1038 1038
 		foreach ( $inputs as $input ) {
1039
-			$field_types[ $input ] = $fields[ $input ];
1039
+			$field_types[$input] = $fields[$input];
1040 1040
 			unset( $input );
1041 1041
 		}
1042 1042
 	}
@@ -1068,7 +1068,7 @@  discard block
 block discarded – undo
1068 1068
 			'parent'  => false,
1069 1069
 			'pointer' => false,
1070 1070
 		);
1071
-		$args     = wp_parse_args( $args, $defaults );
1071
+		$args = wp_parse_args( $args, $defaults );
1072 1072
 
1073 1073
 		$opt_key   = $args['opt_key'];
1074 1074
 		$field     = $args['field'];
@@ -1084,24 +1084,24 @@  discard block
 block discarded – undo
1084 1084
 
1085 1085
 		// Check posted vals before checking saved values
1086 1086
 		// 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
1087
+		if ( $parent && isset( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
1088 1088
 			if ( FrmField::is_field_with_multiple_values( $field ) ) {
1089 1089
 				// phpcs:ignore WordPress.Security.NonceVerification.Missing
1090
-				$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 ] ) ) : '';
1090
+				$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] ) ) : '';
1091 1091
 			} else {
1092
-				$other_val = sanitize_text_field( wp_unslash( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
1092
+				$other_val = sanitize_text_field( wp_unslash( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
1093 1093
 			}
1094 1094
 
1095 1095
 			return $other_val;
1096 1096
 
1097
-		} elseif ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][ $field['id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
1097
+		} elseif ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][$field['id']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
1098 1098
 			// For normal fields
1099 1099
 
1100 1100
 			if ( FrmField::is_field_with_multiple_values( $field ) ) {
1101 1101
 				// phpcs:ignore WordPress.Security.NonceVerification.Missing
1102
-				$other_val = isset( $_POST['item_meta']['other'][ $field['id'] ][ $opt_key ] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][ $field['id'] ][ $opt_key ] ) ) : '';
1102
+				$other_val = isset( $_POST['item_meta']['other'][$field['id']][$opt_key] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][$field['id']][$opt_key] ) ) : '';
1103 1103
 			} else {
1104
-				$other_val = sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][ $field['id'] ] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
1104
+				$other_val = sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][$field['id']] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
1105 1105
 			}
1106 1106
 
1107 1107
 			return $other_val;
@@ -1111,8 +1111,8 @@  discard block
 block discarded – undo
1111 1111
 		if ( $field['type'] === 'checkbox' && is_array( $field['value'] ) ) {
1112 1112
 			// Check if there is an "other" val in saved value and make sure the
1113 1113
 			// "other" val is not equal to the Other checkbox option
1114
-			if ( isset( $field['value'][ $opt_key ] ) && $field['options'][ $opt_key ] != $field['value'][ $opt_key ] ) {
1115
-				$other_val = $field['value'][ $opt_key ];
1114
+			if ( isset( $field['value'][$opt_key] ) && $field['options'][$opt_key] != $field['value'][$opt_key] ) {
1115
+				$other_val = $field['value'][$opt_key];
1116 1116
 			}
1117 1117
 		} else {
1118 1118
 			/**
@@ -1124,8 +1124,8 @@  discard block
 block discarded – undo
1124 1124
 				// Multi-select dropdowns - key is not preserved
1125 1125
 				if ( is_array( $field['value'] ) ) {
1126 1126
 					$o_key = array_search( $temp_val, $field['value'] );
1127
-					if ( isset( $field['value'][ $o_key ] ) ) {
1128
-						unset( $field['value'][ $o_key ], $o_key );
1127
+					if ( isset( $field['value'][$o_key] ) ) {
1128
+						unset( $field['value'][$o_key], $o_key );
1129 1129
 					}
1130 1130
 				} elseif ( $temp_val == $field['value'] ) {
1131 1131
 					// For radio and regular dropdowns
@@ -1167,7 +1167,7 @@  discard block
 block discarded – undo
1167 1167
 			return $other_args;
1168 1168
 		}
1169 1169
 
1170
-		$other_opt  = true;
1170
+		$other_opt = true;
1171 1171
 
1172 1172
 		self::set_other_name( $args, $other_args );
1173 1173
 		self::set_other_value( $args, $other_args );
@@ -1317,7 +1317,7 @@  discard block
 block discarded – undo
1317 1317
 		if ( is_array( $val ) ) {
1318 1318
 			foreach ( $val as $k => $v ) {
1319 1319
 				if ( is_string( $v ) ) {
1320
-					$val[ $k ] = str_replace( $replace, $replace_with, $v );
1320
+					$val[$k] = str_replace( $replace, $replace_with, $v );
1321 1321
 					unset( $k, $v );
1322 1322
 				}
1323 1323
 			}
@@ -1670,7 +1670,7 @@  discard block
 block discarded – undo
1670 1670
 			$countries['class'] = 'frm-countries-opts';
1671 1671
 		}
1672 1672
 
1673
-		$prepop[ __( 'Countries', 'formidable' ) ] = $countries;
1673
+		$prepop[__( 'Countries', 'formidable' )] = $countries;
1674 1674
 
1675 1675
 		// State abv.
1676 1676
 		$states    = self::get_us_states();
@@ -1680,7 +1680,7 @@  discard block
 block discarded – undo
1680 1680
 			$state_abv['class'] = 'frm-state-abv-opts';
1681 1681
 		}
1682 1682
 
1683
-		$prepop[ __( 'U.S. State Abbreviations', 'formidable' ) ] = $state_abv;
1683
+		$prepop[__( 'U.S. State Abbreviations', 'formidable' )] = $state_abv;
1684 1684
 
1685 1685
 		// States.
1686 1686
 		$states = array_values( $states );
@@ -1689,7 +1689,7 @@  discard block
 block discarded – undo
1689 1689
 			$states['class'] = 'frm-states-opts';
1690 1690
 		}
1691 1691
 
1692
-		$prepop[ __( 'U.S. States', 'formidable' ) ] = $states;
1692
+		$prepop[__( 'U.S. States', 'formidable' )] = $states;
1693 1693
 		unset( $state_abv, $states );
1694 1694
 
1695 1695
 		// Age.
@@ -1707,7 +1707,7 @@  discard block
 block discarded – undo
1707 1707
 			$ages['class'] = 'frm-age-opts';
1708 1708
 		}
1709 1709
 
1710
-		$prepop[ __( 'Age', 'formidable' ) ] = $ages;
1710
+		$prepop[__( 'Age', 'formidable' )] = $ages;
1711 1711
 
1712 1712
 		// Satisfaction.
1713 1713
 		$satisfaction = array(
@@ -1722,7 +1722,7 @@  discard block
 block discarded – undo
1722 1722
 			$satisfaction['class'] = 'frm-satisfaction-opts';
1723 1723
 		}
1724 1724
 
1725
-		$prepop[ __( 'Satisfaction', 'formidable' ) ] = $satisfaction;
1725
+		$prepop[__( 'Satisfaction', 'formidable' )] = $satisfaction;
1726 1726
 
1727 1727
 		// Importance.
1728 1728
 		$importance = array(
@@ -1737,7 +1737,7 @@  discard block
 block discarded – undo
1737 1737
 			$importance['class'] = 'frm-importance-opts';
1738 1738
 		}
1739 1739
 
1740
-		$prepop[ __( 'Importance', 'formidable' ) ] = $importance;
1740
+		$prepop[__( 'Importance', 'formidable' )] = $importance;
1741 1741
 
1742 1742
 		// Agreement.
1743 1743
 		$agreement = array(
@@ -1752,7 +1752,7 @@  discard block
 block discarded – undo
1752 1752
 			$agreement['class'] = 'frm-agreement-opts';
1753 1753
 		}
1754 1754
 
1755
-		$prepop[ __( 'Agreement', 'formidable' ) ] = $agreement;
1755
+		$prepop[__( 'Agreement', 'formidable' )] = $agreement;
1756 1756
 
1757 1757
 		// Likely.
1758 1758
 		$likely = array(
@@ -1767,7 +1767,7 @@  discard block
 block discarded – undo
1767 1767
 			$likely['class'] = 'frm-likely-opts';
1768 1768
 		}
1769 1769
 
1770
-		$prepop[ __( 'Likely', 'formidable' ) ] = $likely;
1770
+		$prepop[__( 'Likely', 'formidable' )] = $likely;
1771 1771
 
1772 1772
 		$prepop = apply_filters( 'frm_bulk_field_choices', $prepop );
1773 1773
 	}
@@ -1942,16 +1942,16 @@  discard block
 block discarded – undo
1942 1942
 	 */
1943 1943
 	private static function fill_image_setting_options( $options, &$args ) {
1944 1944
 		foreach ( $options as $key => $option ) {
1945
-			$args['options'][ $key ] = $option;
1945
+			$args['options'][$key] = $option;
1946 1946
 
1947 1947
 			if ( ! empty( $option['addon'] ) ) {
1948
-				$args['options'][ $key ]['custom_attrs'] = self::fill_image_setting_addon_link( $option );
1948
+				$args['options'][$key]['custom_attrs'] = self::fill_image_setting_addon_link( $option );
1949 1949
 			}
1950 1950
 
1951
-			unset( $args['options'][ $key ]['addon'] );
1951
+			unset( $args['options'][$key]['addon'] );
1952 1952
 			$fill = array( 'upgrade', 'message', 'content' );
1953 1953
 			foreach ( $fill as $f ) {
1954
-				unset( $args['options'][ $key ][ $f ], $f );
1954
+				unset( $args['options'][$key][$f], $f );
1955 1955
 			}
1956 1956
 		}
1957 1957
 	}
@@ -1972,8 +1972,8 @@  discard block
 block discarded – undo
1972 1972
 
1973 1973
 		$fill = array( 'upgrade', 'message', 'content' );
1974 1974
 		foreach ( $fill as $f ) {
1975
-			if ( isset( $option[ $f ] ) ) {
1976
-				$custom_attrs[ 'data-' . $f ] = $option[ $f ];
1975
+			if ( isset( $option[$f] ) ) {
1976
+				$custom_attrs['data-' . $f] = $option[$f];
1977 1977
 			}
1978 1978
 		}
1979 1979
 
Please login to merge, or discard this patch.
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.
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
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -117,10 +117,10 @@  discard block
 block discarded – undo
117 117
 		if ( $_POST ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
118 118
 			$repeating = isset( $args['repeating'] ) && $args['repeating'];
119 119
 			if ( $repeating ) {
120
-				if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
120
+				if ( isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
121 121
 					$value_is_posted = true;
122 122
 				}
123
-			} elseif ( isset( $_POST['item_meta'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
123
+			} elseif ( isset( $_POST['item_meta'][$field->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
124 124
 				$value_is_posted = true;
125 125
 			}
126 126
 		}
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 		preg_match_all( "/\[(default-message|default_message)\b(.*?)(?:(\/))?\]/s", $message, $shortcodes, PREG_PATTERN_ORDER );
153 153
 
154 154
 		foreach ( $shortcodes[0] as $short_key => $tag ) {
155
-			$add_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][ $short_key ] );
155
+			$add_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][$short_key] );
156 156
 			if ( ! empty( $add_atts ) ) {
157 157
 				$this_atts = array_merge( $atts, $add_atts );
158 158
 			} else {
@@ -162,14 +162,14 @@  discard block
 block discarded – undo
162 162
 			$default = FrmEntriesController::show_entry_shortcode( $this_atts );
163 163
 
164 164
 			// Add the default message.
165
-			$message = str_replace( $shortcodes[0][ $short_key ], $default, $message );
165
+			$message = str_replace( $shortcodes[0][$short_key], $default, $message );
166 166
 		}
167 167
 
168 168
 		return $message;
169 169
 	}
170 170
 
171 171
 	public static function prepare_display_value( $entry, $field, $atts ) {
172
-		$field_value = isset( $entry->metas[ $field->id ] ) ? $entry->metas[ $field->id ] : false;
172
+		$field_value = isset( $entry->metas[$field->id] ) ? $entry->metas[$field->id] : false;
173 173
 
174 174
 		if ( FrmAppHelper::pro_is_installed() ) {
175 175
 			$empty = empty( $field_value );
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 			$child_entries = FrmEntry::getAll( array( 'it.parent_item_id' => $entry->id ) );
193 193
 		} else {
194 194
 			// Get all values for this field.
195
-			$child_values = isset( $entry->metas[ $atts['embedded_field_id'] ] ) ? $entry->metas[ $atts['embedded_field_id'] ] : false;
195
+			$child_values = isset( $entry->metas[$atts['embedded_field_id']] ) ? $entry->metas[$atts['embedded_field_id']] : false;
196 196
 
197 197
 			if ( $child_values ) {
198 198
 				$child_entries = FrmEntry::getAll( array( 'it.id' => (array) $child_values ) );
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
 			$value = $args['temp_value'];
311 311
 		}
312 312
 		if ( empty( $args['parent_field_id'] ) ) {
313
-			$_POST['item_meta'][ $field->id ] = $value;
313
+			$_POST['item_meta'][$field->id] = $value;
314 314
 		} else {
315 315
 			self::set_parent_field_posted_value( $field, $value, $args );
316 316
 		}
@@ -322,17 +322,17 @@  discard block
 block discarded – undo
322 322
 	 * @since 4.01
323 323
 	 */
324 324
 	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
327
-				$_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing
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
327
+				$_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing
328 328
 			}
329 329
 		} else {
330 330
 			// All of the section was probably removed.
331
-			$_POST['item_meta'][ $args['parent_field_id'] ]                         = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing
332
-			$_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing
331
+			$_POST['item_meta'][$args['parent_field_id']]                         = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing
332
+			$_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing
333 333
 		}
334 334
 
335
-		$_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field->id ] = $value; // phpcs:ignore WordPress.Security.NonceVerification.Missing
335
+		$_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field->id] = $value; // phpcs:ignore WordPress.Security.NonceVerification.Missing
336 336
 	}
337 337
 
338 338
 	public static function get_posted_value( $field, &$value, $args ) {
@@ -362,9 +362,9 @@  discard block
 block discarded – undo
362 362
 	private static function get_posted_meta( $field_id, $args ) {
363 363
 		if ( empty( $args['parent_field_id'] ) ) {
364 364
 			// Sanitizing is done next.
365
-			$value = isset( $_POST['item_meta'][ $field_id ] ) ? wp_unslash( $_POST['item_meta'][ $field_id ] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
365
+			$value = isset( $_POST['item_meta'][$field_id] ) ? wp_unslash( $_POST['item_meta'][$field_id] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
366 366
 		} else {
367
-			$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
367
+			$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
368 368
 		}
369 369
 		return $value;
370 370
 	}
@@ -395,14 +395,14 @@  discard block
 block discarded – undo
395 395
 		self::set_other_repeating_vals( $field, $value, $args );
396 396
 
397 397
 		// 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
398
+		if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][$field->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
399 399
 
400 400
 			// Save original value.
401 401
 			$args['temp_value'] = $value;
402 402
 			$args['other']      = true;
403 403
 
404 404
 			// Sanitizing is done next.
405
-			$other_vals = wp_unslash( $_POST['item_meta']['other'][ $field->id ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
405
+			$other_vals = wp_unslash( $_POST['item_meta']['other'][$field->id] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
406 406
 			FrmAppHelper::sanitize_value( 'sanitize_text_field', $other_vals );
407 407
 
408 408
 			// Set the validation value now
@@ -425,12 +425,12 @@  discard block
 block discarded – undo
425 425
 		}
426 426
 
427 427
 		// 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
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
429 429
 			// Save original value
430 430
 			$args['temp_value'] = $value;
431 431
 			$args['other']      = true;
432 432
 
433
-			$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
433
+			$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
434 434
 			FrmAppHelper::sanitize_value( 'sanitize_text_field', $other_vals );
435 435
 
436 436
 			// Set the validation value now.
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
 		if ( is_array( $value ) && $field->type === 'checkbox' ) {
458 458
 			// Combine "Other" values with checked values. "Other" values will override checked box values.
459 459
 			foreach ( $other_vals as $k => $v ) {
460
-				if ( isset( $value[ $k ] ) && trim( $v ) === '' ) {
460
+				if ( isset( $value[$k] ) && trim( $v ) === '' ) {
461 461
 					// If the other box is checked, but doesn't have a value.
462 462
 					$value = '';
463 463
 					break;
@@ -474,25 +474,25 @@  discard block
 block discarded – undo
474 474
 
475 475
 			// Multi-select dropdown.
476 476
 			if ( is_array( $value ) ) {
477
-				$o_key = array_search( $field->options[ $other_key ], $value );
477
+				$o_key = array_search( $field->options[$other_key], $value );
478 478
 
479 479
 				if ( $o_key !== false ) {
480 480
 					// Modify the original value so other key will be preserved.
481
-					$value[ $other_key ] = $value[ $o_key ];
481
+					$value[$other_key] = $value[$o_key];
482 482
 
483 483
 					// By default, the array keys will be numeric for multi-select dropdowns.
484 484
 					// If going backwards and forwards between pages, the array key will match the other key.
485 485
 					if ( $o_key !== $other_key ) {
486
-						unset( $value[ $o_key ] );
486
+						unset( $value[$o_key] );
487 487
 					}
488 488
 
489 489
 					$args['temp_value']  = $value;
490
-					$value[ $other_key ] = reset( $other_vals );
491
-					if ( FrmAppHelper::is_empty_value( $value[ $other_key ] ) ) {
492
-						unset( $value[ $other_key ] );
490
+					$value[$other_key] = reset( $other_vals );
491
+					if ( FrmAppHelper::is_empty_value( $value[$other_key] ) ) {
492
+						unset( $value[$other_key] );
493 493
 					}
494 494
 				}
495
-			} elseif ( $field->options[ $other_key ] == $value ) {
495
+			} elseif ( $field->options[$other_key] == $value ) {
496 496
 				$value = $other_vals;
497 497
 			}
498 498
 		}
Please login to merge, or discard this patch.
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.
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   +72 added lines, -72 removed lines patch added patch discarded remove patch
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 			'fill'   => '#4d4d4d',
158 158
 			'orange' => '#f05a24',
159 159
 		);
160
-		$atts     = array_merge( $defaults, $atts );
160
+		$atts = array_merge( $defaults, $atts );
161 161
 
162 162
 		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'] ) . '">
163 163
 			<path fill="' . esc_attr( $atts['orange'] ) . '" d="M289.6 384h140v76h-140z"/>
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
 	 * @return string
365 365
 	 */
366 366
 	public static function get_server_value( $value ) {
367
-		return isset( $_SERVER[ $value ] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[ $value ] ) ) : '';
367
+		return isset( $_SERVER[$value] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[$value] ) ) : '';
368 368
 	}
369 369
 
370 370
 	/**
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
 		);
388 388
 		$ip = '';
389 389
 		foreach ( $ip_options as $key ) {
390
-			if ( ! isset( $_SERVER[ $key ] ) ) {
390
+			if ( ! isset( $_SERVER[$key] ) ) {
391 391
 				continue;
392 392
 			}
393 393
 
@@ -411,10 +411,10 @@  discard block
 block discarded – undo
411 411
 		}
412 412
 
413 413
 		if ( $src === 'get' ) {
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
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
416 416
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
417
-				$value = htmlspecialchars_decode( wp_unslash( $_GET[ $param ] ) );
417
+				$value = htmlspecialchars_decode( wp_unslash( $_GET[$param] ) );
418 418
 			}
419 419
 			self::sanitize_value( $sanitize, $value );
420 420
 		} else {
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
 				}
436 436
 
437 437
 				$p     = trim( $p, ']' );
438
-				$value = isset( $value[ $p ] ) ? $value[ $p ] : $default;
438
+				$value = isset( $value[$p] ) ? $value[$p] : $default;
439 439
 			}
440 440
 		}
441 441
 
@@ -491,26 +491,26 @@  discard block
 block discarded – undo
491 491
 			'sanitize' => 'sanitize_text_field',
492 492
 			'serialized' => false,
493 493
 		);
494
-		$args     = wp_parse_args( $args, $defaults );
494
+		$args = wp_parse_args( $args, $defaults );
495 495
 
496 496
 		$value = $args['default'];
497 497
 		if ( $args['type'] == 'get' ) {
498
-			if ( $_GET && isset( $_GET[ $args['param'] ] ) ) {
498
+			if ( $_GET && isset( $_GET[$args['param']] ) ) {
499 499
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
500
-				$value = wp_unslash( $_GET[ $args['param'] ] );
500
+				$value = wp_unslash( $_GET[$args['param']] );
501 501
 			}
502 502
 		} elseif ( $args['type'] == 'post' ) {
503
-			if ( isset( $_POST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
503
+			if ( isset( $_POST[$args['param']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
504 504
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
505
-				$value = wp_unslash( $_POST[ $args['param'] ] );
505
+				$value = wp_unslash( $_POST[$args['param']] );
506 506
 				if ( $args['serialized'] === true && is_serialized_string( $value ) && is_serialized( $value ) ) {
507 507
 					self::unserialize_or_decode( $value );
508 508
 				}
509 509
 			}
510 510
 		} else {
511
-			if ( isset( $_REQUEST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
511
+			if ( isset( $_REQUEST[$args['param']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
512 512
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
513
-				$value = wp_unslash( $_REQUEST[ $args['param'] ] );
513
+				$value = wp_unslash( $_REQUEST[$args['param']] );
514 514
 			}
515 515
 		}
516 516
 
@@ -542,7 +542,7 @@  discard block
 block discarded – undo
542 542
 			if ( is_array( $value ) ) {
543 543
 				$temp_values = $value;
544 544
 				foreach ( $temp_values as $k => $v ) {
545
-					self::sanitize_value( $sanitize, $value[ $k ] );
545
+					self::sanitize_value( $sanitize, $value[$k] );
546 546
 				}
547 547
 			} else {
548 548
 				$value = call_user_func( $sanitize, $value );
@@ -553,8 +553,8 @@  discard block
 block discarded – undo
553 553
 	public static function sanitize_request( $sanitize_method, &$values ) {
554 554
 		$temp_values = $values;
555 555
 		foreach ( $temp_values as $k => $val ) {
556
-			if ( isset( $sanitize_method[ $k ] ) ) {
557
-				$values[ $k ] = call_user_func( $sanitize_method[ $k ], $val );
556
+			if ( isset( $sanitize_method[$k] ) ) {
557
+				$values[$k] = call_user_func( $sanitize_method[$k], $val );
558 558
 			}
559 559
 		}
560 560
 	}
@@ -577,7 +577,7 @@  discard block
 block discarded – undo
577 577
 		if ( is_array( $value ) ) {
578 578
 			$temp_values = $value;
579 579
 			foreach ( $temp_values as $k => $v ) {
580
-				self::decode_specialchars( $value[ $k ] );
580
+				self::decode_specialchars( $value[$k] );
581 581
 			}
582 582
 		} else {
583 583
 			self::decode_amp( $value );
@@ -697,7 +697,7 @@  discard block
 block discarded – undo
697 697
 	 * @return array
698 698
 	 */
699 699
 	public static function add_allowed_submit_button_tags( $allowed_html ) {
700
-		$allowed_html['input']                    = array(
700
+		$allowed_html['input'] = array(
701 701
 			'type'           => true,
702 702
 			'value'          => true,
703 703
 			'formnovalidate' => true,
@@ -720,7 +720,7 @@  discard block
 block discarded – undo
720 720
 			$allowed_html = $html;
721 721
 		} elseif ( ! empty( $allowed ) ) {
722 722
 			foreach ( (array) $allowed as $a ) {
723
-				$allowed_html[ $a ] = isset( $html[ $a ] ) ? $html[ $a ] : array();
723
+				$allowed_html[$a] = isset( $html[$a] ) ? $html[$a] : array();
724 724
 			}
725 725
 		}
726 726
 
@@ -899,8 +899,8 @@  discard block
 block discarded – undo
899 899
 		}
900 900
 
901 901
 		global $wp_query;
902
-		if ( isset( $wp_query->query_vars[ $param ] ) ) {
903
-			$value = $wp_query->query_vars[ $param ];
902
+		if ( isset( $wp_query->query_vars[$param] ) ) {
903
+			$value = $wp_query->query_vars[$param];
904 904
 		}
905 905
 
906 906
 		return $value;
@@ -1138,7 +1138,7 @@  discard block
 block discarded – undo
1138 1138
 				'new_file_path' => self::plugin_path() . '/js',
1139 1139
 			)
1140 1140
 		);
1141
-		$new_file  = new FrmCreateFile( $file_atts );
1141
+		$new_file = new FrmCreateFile( $file_atts );
1142 1142
 
1143 1143
 		$files = array(
1144 1144
 			self::plugin_path() . '/js/formidable.min.js',
@@ -1566,8 +1566,8 @@  discard block
 block discarded – undo
1566 1566
 			return $error;
1567 1567
 		}
1568 1568
 
1569
-		$nonce_value = ( $_REQUEST && isset( $_REQUEST[ $nonce_name ] ) ) ? sanitize_text_field( wp_unslash( $_REQUEST[ $nonce_name ] ) ) : '';
1570
-		if ( $_REQUEST && ( ! isset( $_REQUEST[ $nonce_name ] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) {
1569
+		$nonce_value = ( $_REQUEST && isset( $_REQUEST[$nonce_name] ) ) ? sanitize_text_field( wp_unslash( $_REQUEST[$nonce_name] ) ) : '';
1570
+		if ( $_REQUEST && ( ! isset( $_REQUEST[$nonce_name] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) {
1571 1571
 			$frm_settings = self::get_settings();
1572 1572
 			$error        = $frm_settings->admin_permission;
1573 1573
 		}
@@ -1602,7 +1602,7 @@  discard block
 block discarded – undo
1602 1602
 			} else {
1603 1603
 				foreach ( $value as $k => $v ) {
1604 1604
 					if ( ! is_array( $v ) ) {
1605
-						$value[ $k ] = call_user_func( $original_function, $v );
1605
+						$value[$k] = call_user_func( $original_function, $v );
1606 1606
 					}
1607 1607
 				}
1608 1608
 			}
@@ -1627,7 +1627,7 @@  discard block
 block discarded – undo
1627 1627
 				$return = array_merge( $return, self::array_flatten( $value, $keys ) );
1628 1628
 			} else {
1629 1629
 				if ( $keys == 'keep' ) {
1630
-					$return[ $key ] = $value;
1630
+					$return[$key] = $value;
1631 1631
 				} else {
1632 1632
 					$return[] = $value;
1633 1633
 				}
@@ -1680,11 +1680,11 @@  discard block
 block discarded – undo
1680 1680
 		}
1681 1681
 
1682 1682
 		$ver = $default;
1683
-		if ( ! isset( $wp_scripts->registered[ $handle ] ) ) {
1683
+		if ( ! isset( $wp_scripts->registered[$handle] ) ) {
1684 1684
 			return $ver;
1685 1685
 		}
1686 1686
 
1687
-		$query = $wp_scripts->registered[ $handle ];
1687
+		$query = $wp_scripts->registered[$handle];
1688 1688
 		if ( is_object( $query ) && ! empty( $query->ver ) ) {
1689 1689
 			$ver = $query->ver;
1690 1690
 		}
@@ -1861,7 +1861,7 @@  discard block
 block discarded – undo
1861 1861
 
1862 1862
 		foreach ( array( 'name', 'description' ) as $var ) {
1863 1863
 			$default_val    = isset( $record->{$var} ) ? $record->{$var} : '';
1864
-			$values[ $var ] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' );
1864
+			$values[$var] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' );
1865 1865
 			unset( $var, $default_val );
1866 1866
 		}
1867 1867
 
@@ -1919,9 +1919,9 @@  discard block
 block discarded – undo
1919 1919
 			}
1920 1920
 		}
1921 1921
 
1922
-		$field_type = isset( $post_values['field_options'][ 'type_' . $field->id ] ) ? $post_values['field_options'][ 'type_' . $field->id ] : $field->type;
1923
-		if ( isset( $post_values['item_meta'][ $field->id ] ) ) {
1924
-			$new_value = $post_values['item_meta'][ $field->id ];
1922
+		$field_type = isset( $post_values['field_options']['type_' . $field->id] ) ? $post_values['field_options']['type_' . $field->id] : $field->type;
1923
+		if ( isset( $post_values['item_meta'][$field->id] ) ) {
1924
+			$new_value = $post_values['item_meta'][$field->id];
1925 1925
 			self::unserialize_or_decode( $new_value );
1926 1926
 		} else {
1927 1927
 			$new_value = $meta_value;
@@ -1942,7 +1942,7 @@  discard block
 block discarded – undo
1942 1942
 
1943 1943
 		$field_array = array_merge( (array) $field->field_options, $field_array );
1944 1944
 
1945
-		$values['fields'][ $field->id ] = $field_array;
1945
+		$values['fields'][$field->id] = $field_array;
1946 1946
 	}
1947 1947
 
1948 1948
 	/**
@@ -1989,11 +1989,11 @@  discard block
 block discarded – undo
1989 1989
 		}
1990 1990
 
1991 1991
 		foreach ( $form->options as $opt => $value ) {
1992
-			if ( isset( $post_values[ $opt ] ) ) {
1993
-				$values[ $opt ] = $post_values[ $opt ];
1994
-				self::unserialize_or_decode( $values[ $opt ] );
1992
+			if ( isset( $post_values[$opt] ) ) {
1993
+				$values[$opt] = $post_values[$opt];
1994
+				self::unserialize_or_decode( $values[$opt] );
1995 1995
 			} else {
1996
-				$values[ $opt ] = $value;
1996
+				$values[$opt] = $value;
1997 1997
 			}
1998 1998
 		}
1999 1999
 
@@ -2007,8 +2007,8 @@  discard block
 block discarded – undo
2007 2007
 		$form_defaults = FrmFormsHelper::get_default_opts();
2008 2008
 
2009 2009
 		foreach ( $form_defaults as $opt => $default ) {
2010
-			if ( ! isset( $values[ $opt ] ) || $values[ $opt ] == '' ) {
2011
-				$values[ $opt ] = ( $post_values && isset( $post_values['options'][ $opt ] ) ) ? $post_values['options'][ $opt ] : $default;
2010
+			if ( ! isset( $values[$opt] ) || $values[$opt] == '' ) {
2011
+				$values[$opt] = ( $post_values && isset( $post_values['options'][$opt] ) ) ? $post_values['options'][$opt] : $default;
2012 2012
 			}
2013 2013
 
2014 2014
 			unset( $opt, $default );
@@ -2019,8 +2019,8 @@  discard block
 block discarded – undo
2019 2019
 		}
2020 2020
 
2021 2021
 		foreach ( array( 'before', 'after', 'submit' ) as $h ) {
2022
-			if ( ! isset( $values[ $h . '_html' ] ) ) {
2023
-				$values[ $h . '_html' ] = ( isset( $post_values['options'][ $h . '_html' ] ) ? $post_values['options'][ $h . '_html' ] : FrmFormsHelper::get_default_html( $h ) );
2022
+			if ( ! isset( $values[$h . '_html'] ) ) {
2023
+				$values[$h . '_html'] = ( isset( $post_values['options'][$h . '_html'] ) ? $post_values['options'][$h . '_html'] : FrmFormsHelper::get_default_html( $h ) );
2024 2024
 			}
2025 2025
 			unset( $h );
2026 2026
 		}
@@ -2172,25 +2172,25 @@  discard block
 block discarded – undo
2172 2172
 		if ( ! is_numeric( $levels ) ) {
2173 2173
 			// Show time in specified unit.
2174 2174
 			$levels = self::get_unit( $levels );
2175
-			if ( isset( $time_strings[ $levels ] ) ) {
2175
+			if ( isset( $time_strings[$levels] ) ) {
2176 2176
 				$diff = array(
2177 2177
 					$levels => self::time_format( $levels, $diff ),
2178 2178
 				);
2179 2179
 				$time_strings = array(
2180
-					$levels => $time_strings[ $levels ],
2180
+					$levels => $time_strings[$levels],
2181 2181
 				);
2182 2182
 			}
2183 2183
 			$levels = 1;
2184 2184
 		}
2185 2185
 
2186 2186
 		foreach ( $time_strings as $k => $v ) {
2187
-			if ( isset( $diff[ $k ] ) && $diff[ $k ] ) {
2188
-				$time_strings[ $k ] = $diff[ $k ] . ' ' . ( $diff[ $k ] > 1 ? $v[1] : $v[0] );
2189
-			} elseif ( isset( $diff[ $k ] ) && count( $time_strings ) === 1 ) {
2187
+			if ( isset( $diff[$k] ) && $diff[$k] ) {
2188
+				$time_strings[$k] = $diff[$k] . ' ' . ( $diff[$k] > 1 ? $v[1] : $v[0] );
2189
+			} elseif ( isset( $diff[$k] ) && count( $time_strings ) === 1 ) {
2190 2190
 				// Account for 0.
2191
-				$time_strings[ $k ] = $diff[ $k ] . ' ' . $v[1];
2191
+				$time_strings[$k] = $diff[$k] . ' ' . $v[1];
2192 2192
 			} else {
2193
-				unset( $time_strings[ $k ] );
2193
+				unset( $time_strings[$k] );
2194 2194
 			}
2195 2195
 		}
2196 2196
 
@@ -2209,8 +2209,8 @@  discard block
 block discarded – undo
2209 2209
 			'y' => 'y',
2210 2210
 			'd' => 'days',
2211 2211
 		);
2212
-		if ( isset( $return[ $unit ] ) ) {
2213
-			return $diff[ $return[ $unit ] ];
2212
+		if ( isset( $return[$unit] ) ) {
2213
+			return $diff[$return[$unit]];
2214 2214
 		}
2215 2215
 
2216 2216
 		$total = $diff['days'] * self::convert_time( 'd', $unit );
@@ -2218,11 +2218,11 @@  discard block
 block discarded – undo
2218 2218
 		$times = array( 'h', 'i', 's' );
2219 2219
 
2220 2220
 		foreach ( $times as $time ) {
2221
-			if ( ! isset( $diff[ $time ] ) ) {
2221
+			if ( ! isset( $diff[$time] ) ) {
2222 2222
 				continue;
2223 2223
 			}
2224 2224
 
2225
-			$total += $diff[ $time ] * self::convert_time( $time, $unit );
2225
+			$total += $diff[$time] * self::convert_time( $time, $unit );
2226 2226
 		}
2227 2227
 
2228 2228
 		return floor( $total );
@@ -2242,7 +2242,7 @@  discard block
 block discarded – undo
2242 2242
 			'y' => DAY_IN_SECONDS * 365.25,
2243 2243
 		);
2244 2244
 
2245
-		return $convert[ $from ] / $convert[ $to ];
2245
+		return $convert[$from] / $convert[$to];
2246 2246
 	}
2247 2247
 
2248 2248
 	/**
@@ -2250,7 +2250,7 @@  discard block
 block discarded – undo
2250 2250
 	 */
2251 2251
 	private static function get_unit( $unit ) {
2252 2252
 		$units = self::get_time_strings();
2253
-		if ( isset( $units[ $unit ] ) || is_numeric( $unit ) ) {
2253
+		if ( isset( $units[$unit] ) || is_numeric( $unit ) ) {
2254 2254
 			return $unit;
2255 2255
 		}
2256 2256
 
@@ -2361,17 +2361,17 @@  discard block
 block discarded – undo
2361 2361
 
2362 2362
 					case 1:
2363 2363
 						$l2 = $name;
2364
-						self::add_value_to_array( $name, $l2, $this_val, $vars[ $l1 ] );
2364
+						self::add_value_to_array( $name, $l2, $this_val, $vars[$l1] );
2365 2365
 						break;
2366 2366
 
2367 2367
 					case 2:
2368 2368
 						$l3 = $name;
2369
-						self::add_value_to_array( $name, $l3, $this_val, $vars[ $l1 ][ $l2 ] );
2369
+						self::add_value_to_array( $name, $l3, $this_val, $vars[$l1][$l2] );
2370 2370
 						break;
2371 2371
 
2372 2372
 					case 3:
2373 2373
 						$l4 = $name;
2374
-						self::add_value_to_array( $name, $l4, $this_val, $vars[ $l1 ][ $l2 ][ $l3 ] );
2374
+						self::add_value_to_array( $name, $l4, $this_val, $vars[$l1][$l2][$l3] );
2375 2375
 				}
2376 2376
 
2377 2377
 				unset( $this_val, $n );
@@ -2390,8 +2390,8 @@  discard block
 block discarded – undo
2390 2390
 	public static function add_value_to_array( $name, $l1, $val, &$vars ) {
2391 2391
 		if ( $name == '' ) {
2392 2392
 			$vars[] = $val;
2393
-		} elseif ( ! isset( $vars[ $l1 ] ) ) {
2394
-			$vars[ $l1 ] = $val;
2393
+		} elseif ( ! isset( $vars[$l1] ) ) {
2394
+			$vars[$l1] = $val;
2395 2395
 		}
2396 2396
 	}
2397 2397
 
@@ -2407,7 +2407,7 @@  discard block
 block discarded – undo
2407 2407
 			'email_subject' => esc_attr( sprintf( __( 'If you leave the subject blank, the default will be used: %1$s Form submitted on %2$s', 'formidable' ), $form_name, self::site_name() ) ),
2408 2408
 		);
2409 2409
 
2410
-		if ( ! isset( $tooltips[ $name ] ) ) {
2410
+		if ( ! isset( $tooltips[$name] ) ) {
2411 2411
 			return;
2412 2412
 		}
2413 2413
 
@@ -2417,7 +2417,7 @@  discard block
 block discarded – undo
2417 2417
 			echo ' class="frm_help"';
2418 2418
 		}
2419 2419
 
2420
-		echo ' title="' . esc_attr( $tooltips[ $name ] );
2420
+		echo ' title="' . esc_attr( $tooltips[$name] );
2421 2421
 
2422 2422
 		if ( 'open' != $class ) {
2423 2423
 			echo '"';
@@ -2472,13 +2472,13 @@  discard block
 block discarded – undo
2472 2472
 	}
2473 2473
 
2474 2474
 	private static function prepare_action_slashes( $val, $key, &$post_content ) {
2475
-		if ( ! isset( $post_content[ $key ] ) || is_numeric( $val ) ) {
2475
+		if ( ! isset( $post_content[$key] ) || is_numeric( $val ) ) {
2476 2476
 			return;
2477 2477
 		}
2478 2478
 
2479 2479
 		if ( is_array( $val ) ) {
2480 2480
 			foreach ( $val as $k1 => $v1 ) {
2481
-				self::prepare_action_slashes( $v1, $k1, $post_content[ $key ] );
2481
+				self::prepare_action_slashes( $v1, $k1, $post_content[$key] );
2482 2482
 				unset( $k1, $v1 );
2483 2483
 			}
2484 2484
 		} else {
@@ -2486,7 +2486,7 @@  discard block
 block discarded – undo
2486 2486
 			$val = stripslashes( $val );
2487 2487
 
2488 2488
 			// Add backslashes before double quotes and forward slashes only
2489
-			$post_content[ $key ] = addcslashes( $val, '"\\/' );
2489
+			$post_content[$key] = addcslashes( $val, '"\\/' );
2490 2490
 		}
2491 2491
 	}
2492 2492
 
@@ -2545,14 +2545,14 @@  discard block
 block discarded – undo
2545 2545
 				continue;
2546 2546
 			}
2547 2547
 			$key = $input['name'];
2548
-			if ( isset( $formatted[ $key ] ) ) {
2549
-				if ( is_array( $formatted[ $key ] ) ) {
2550
-					$formatted[ $key ][] = $input['value'];
2548
+			if ( isset( $formatted[$key] ) ) {
2549
+				if ( is_array( $formatted[$key] ) ) {
2550
+					$formatted[$key][] = $input['value'];
2551 2551
 				} else {
2552
-					$formatted[ $key ] = array( $formatted[ $key ], $input['value'] );
2552
+					$formatted[$key] = array( $formatted[$key], $input['value'] );
2553 2553
 				}
2554 2554
 			} else {
2555
-				$formatted[ $key ] = $input['value'];
2555
+				$formatted[$key] = $input['value'];
2556 2556
 			}
2557 2557
 		}
2558 2558
 
@@ -3142,8 +3142,8 @@  discard block
 block discarded – undo
3142 3142
 		}
3143 3143
 
3144 3144
 		foreach ( $keys as $key ) {
3145
-			if ( isset( $values[ $key ] ) ) {
3146
-				$values[ $key ] = self::kses( $values[ $key ], 'all' );
3145
+			if ( isset( $values[$key] ) ) {
3146
+				$values[$key] = self::kses( $values[$key], 'all' );
3147 3147
 			}
3148 3148
 		}
3149 3149
 
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.
classes/helpers/FrmStylesHelper.php 2 patches
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
 				'-' => 'down',
195 195
 				'+' => 'up',
196 196
 			);
197
-			$class = 'frm_arrow' . $arrow[ $icon ];
197
+			$class = 'frm_arrow' . $arrow[$icon];
198 198
 		} else {
199 199
 			//frm_minus1_icon
200 200
 			$key   = str_replace( 'p', '', $key );
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 				'-' => 'minus',
203 203
 				'+' => 'plus',
204 204
 			);
205
-			$class = 'frm_' . $plus[ $icon ];
205
+			$class = 'frm_' . $plus[$icon];
206 206
 		}
207 207
 
208 208
 		if ( $key ) {
@@ -222,8 +222,8 @@  discard block
 block discarded – undo
222 222
 		?>
223 223
 		<div class="btn-group" id="frm_<?php echo esc_attr( $name ); ?>_select">
224 224
 			<button class="multiselect dropdown-toggle btn btn-default" data-toggle="dropdown" type="button">
225
-				<?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[ $name ], '+', $type ) ); ?>
226
-				<?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[ $name ], '-', $type ) ); ?>
225
+				<?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[$name], '+', $type ) ); ?>
226
+				<?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[$name], '-', $type ) ); ?>
227 227
 				<b class="caret"></b>
228 228
 			</button>
229 229
 			<ul class="multiselect-container frm-dropdown-menu">
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
 					<li <?php echo ( $style->post_content['collapse_icon'] == $key ) ? 'class="active"' : ''; ?>>
232 232
 						<a href="javascript:void(0);">
233 233
 							<label>
234
-								<input type="radio" value="<?php echo esc_attr( $key ); ?>" name="<?php echo esc_attr( $frm_style->get_field_name( $name ) ); ?>" <?php checked( $style->post_content[ $name ], $key ); ?>/>
234
+								<input type="radio" value="<?php echo esc_attr( $key ); ?>" name="<?php echo esc_attr( $frm_style->get_field_name( $name ) ); ?>" <?php checked( $style->post_content[$name], $key ); ?>/>
235 235
 								<span>
236 236
 									<?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $key, '+', $type ) ); ?>
237 237
 									<?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $key, '-', $type ) ); ?>
@@ -313,15 +313,15 @@  discard block
 block discarded – undo
313 313
 		$vars   = array_diff( $vars, $remove );
314 314
 
315 315
 		foreach ( $vars as $var ) {
316
-			if ( ! isset( $settings[ $var ] ) ) {
316
+			if ( ! isset( $settings[$var] ) ) {
317 317
 				continue;
318 318
 			}
319
-			if ( ! isset( $defaults[ $var ] ) ) {
320
-				$defaults[ $var ] = '';
319
+			if ( ! isset( $defaults[$var] ) ) {
320
+				$defaults[$var] = '';
321 321
 			}
322
-			$show = empty( $defaults ) || ( $settings[ $var ] !== '' && $settings[ $var ] !== $defaults[ $var ] );
322
+			$show = empty( $defaults ) || ( $settings[$var] !== '' && $settings[$var] !== $defaults[$var] );
323 323
 			if ( $show ) {
324
-				echo '--' . esc_html( str_replace( '_', '-', $var ) ) . ':' . ( $var === 'font' ? FrmAppHelper::kses( $settings[ $var ] ) : esc_html( $settings[ $var ] ) ) . ';'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
324
+				echo '--' . esc_html( str_replace( '_', '-', $var ) ) . ':' . ( $var === 'font' ? FrmAppHelper::kses( $settings[$var] ) : esc_html( $settings[$var] ) ) . ';'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
325 325
 			}
326 326
 		}
327 327
 	}
@@ -371,8 +371,8 @@  discard block
 block discarded – undo
371 371
 
372 372
 		$checkbox_opts = array( 'important_style', 'auto_width', 'submit_style', 'collapse_icon', 'center_form' );
373 373
 		foreach ( $checkbox_opts as $opt ) {
374
-			if ( ! isset( $settings[ $opt ] ) ) {
375
-				$settings[ $opt ] = 0;
374
+			if ( ! isset( $settings[$opt] ) ) {
375
+				$settings[$opt] = 0;
376 376
 			}
377 377
 		}
378 378
 
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
 				$css = '';
401 401
 			}
402 402
 			foreach ( $opts as $opt ) {
403
-				self::get_color_output( $css, $settings[ $opt ] );
403
+				self::get_color_output( $css, $settings[$opt] );
404 404
 			}
405 405
 		}
406 406
 	}
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -336,7 +336,8 @@
 block discarded – undo
336 336
 		if ( self::previewing_style() ) {
337 337
 
338 338
 			$frm_style = new FrmStyle();
339
-			if ( isset( $_POST['frm_style_setting'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
339
+			if ( isset( $_POST['frm_style_setting'] ) ) {
340
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
340 341
 
341 342
 				// Sanitizing is done later.
342 343
 				$posted = wp_unslash( $_POST['frm_style_setting'] ); //phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
Please login to merge, or discard this patch.
classes/models/FrmStyle.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 			$this->id     = $new_instance['ID'];
58 58
 			// phpcs:ignore WordPress.Security.NonceVerification.Missing
59 59
 			if ( $id != $this->id || ! $_POST || ! isset( $_POST['frm_style_setting'] ) ) {
60
-				$all_instances[ $number ] = $new_instance;
60
+				$all_instances[$number] = $new_instance;
61 61
 
62 62
 				// phpcs:ignore WordPress.Security.NonceVerification.Missing
63 63
 				if ( $new_instance['menu_order'] && $_POST && empty( $_POST['prev_menu_order'] ) && isset( $_POST['frm_style_setting']['menu_order'] ) ) {
@@ -83,22 +83,22 @@  discard block
 block discarded – undo
83 83
 			$default_settings = $this->get_defaults();
84 84
 
85 85
 			foreach ( $default_settings as $setting => $default ) {
86
-				if ( ! isset( $new_instance['post_content'][ $setting ] ) ) {
87
-					$new_instance['post_content'][ $setting ] = $default;
86
+				if ( ! isset( $new_instance['post_content'][$setting] ) ) {
87
+					$new_instance['post_content'][$setting] = $default;
88 88
 				}
89 89
 
90 90
 				if ( $this->is_color( $setting ) ) {
91
-					$new_instance['post_content'][ $setting ] = str_replace( '#', '', $new_instance['post_content'][ $setting ] );
91
+					$new_instance['post_content'][$setting] = str_replace( '#', '', $new_instance['post_content'][$setting] );
92 92
 				} elseif ( in_array( $setting, array( 'submit_style', 'important_style', 'auto_width' ) )
93
-					&& ! isset( $new_instance['post_content'][ $setting ] )
93
+					&& ! isset( $new_instance['post_content'][$setting] )
94 94
 					) {
95
-					$new_instance['post_content'][ $setting ] = 0;
95
+					$new_instance['post_content'][$setting] = 0;
96 96
 				} elseif ( $setting == 'font' ) {
97
-					$new_instance['post_content'][ $setting ] = $this->force_balanced_quotation( $new_instance['post_content'][ $setting ] );
97
+					$new_instance['post_content'][$setting] = $this->force_balanced_quotation( $new_instance['post_content'][$setting] );
98 98
 				}
99 99
 			}
100 100
 
101
-			$all_instances[ $number ] = $new_instance;
101
+			$all_instances[$number] = $new_instance;
102 102
 
103 103
 			$action_ids[] = $this->save( $new_instance );
104 104
 
@@ -135,10 +135,10 @@  discard block
 block discarded – undo
135 135
 		$valid_keys         = array_keys( $defaults );
136 136
 		$sanitized_settings = array();
137 137
 		foreach ( $valid_keys as $key ) {
138
-			if ( isset( $settings[ $key ] ) ) {
139
-				$sanitized_settings[ $key ] = sanitize_textarea_field( $settings[ $key ] );
138
+			if ( isset( $settings[$key] ) ) {
139
+				$sanitized_settings[$key] = sanitize_textarea_field( $settings[$key] );
140 140
 			} else {
141
-				$sanitized_settings[ $key ] = $defaults[ $key ];
141
+				$sanitized_settings[$key] = $defaults[$key];
142 142
 			}
143 143
 		}
144 144
 		return $sanitized_settings;
@@ -305,13 +305,13 @@  discard block
 block discarded – undo
305 305
 			$style->post_content = $this->override_defaults( $style->post_content );
306 306
 			$style->post_content = wp_parse_args( $style->post_content, $default_values );
307 307
 
308
-			$styles[ $style->ID ] = $style;
308
+			$styles[$style->ID] = $style;
309 309
 		}
310 310
 
311 311
 		if ( ! $default_style ) {
312 312
 			$default_style = reset( $styles );
313 313
 
314
-			$styles[ $default_style->ID ]->menu_order = 1;
314
+			$styles[$default_style->ID]->menu_order = 1;
315 315
 		}
316 316
 
317 317
 		return $styles;
Please login to merge, or discard this patch.
classes/models/FrmEntryValidate.php 2 patches
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 			return $errors;
15 15
 		}
16 16
 
17
-		if ( FrmAppHelper::is_admin() && is_user_logged_in() && ( ! isset( $values[ 'frm_submit_entry_' . $values['form_id'] ] ) || ! wp_verify_nonce( $values[ 'frm_submit_entry_' . $values['form_id'] ], 'frm_submit_entry_nonce' ) ) ) {
17
+		if ( FrmAppHelper::is_admin() && is_user_logged_in() && ( ! isset( $values['frm_submit_entry_' . $values['form_id']] ) || ! wp_verify_nonce( $values['frm_submit_entry_' . $values['form_id']], 'frm_submit_entry_nonce' ) ) ) {
18 18
 			$errors['form'] = __( 'You do not have permission to do that', 'formidable' );
19 19
 		}
20 20
 
@@ -87,10 +87,10 @@  discard block
 block discarded – undo
87 87
 			'key_pointer'     => '', // the pointer in the posted array
88 88
 			'exclude'         => array(), // exclude these field types from validation
89 89
 		);
90
-		$args     = wp_parse_args( $args, $defaults );
90
+		$args = wp_parse_args( $args, $defaults );
91 91
 
92 92
 		if ( empty( $args['parent_field_id'] ) ) {
93
-			$value = isset( $values['item_meta'][ $args['id'] ] ) ? $values['item_meta'][ $args['id'] ] : '';
93
+			$value = isset( $values['item_meta'][$args['id']] ) ? $values['item_meta'][$args['id']] : '';
94 94
 		} else {
95 95
 			// value is from a nested form
96 96
 			$value = $values;
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 		}
112 112
 
113 113
 		if ( $posted_field->required == '1' && FrmAppHelper::is_empty_value( $value ) ) {
114
-			$errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $posted_field, 'blank' );
114
+			$errors['field' . $args['id']] = FrmFieldsHelper::get_error_msg( $posted_field, 'blank' );
115 115
 		} elseif ( $posted_field->type === 'text' && ! isset( $_POST['item_name'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
116 116
 			$_POST['item_name'] = $value;
117 117
 		}
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 			$pattern = self::phone_format( $field );
167 167
 
168 168
 			if ( ! preg_match( $pattern, $value ) ) {
169
-				$errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $field, 'invalid' );
169
+				$errors['field' . $args['id']] = FrmFieldsHelper::get_error_msg( $field, 'invalid' );
170 170
 			}
171 171
 		}
172 172
 	}
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
 	 */
277 277
 	private static function form_is_in_progress( $values ) {
278 278
 		return FrmAppHelper::pro_is_installed() &&
279
-			( isset( $values[ 'frm_page_order_' . $values['form_id'] ] ) || FrmAppHelper::get_post_param( 'frm_next_page' ) ) &&
279
+			( isset( $values['frm_page_order_' . $values['form_id']] ) || FrmAppHelper::get_post_param( 'frm_next_page' ) ) &&
280 280
 			FrmField::get_all_types_in_form( $values['form_id'], 'break' );
281 281
 	}
282 282
 
@@ -521,9 +521,9 @@  discard block
 block discarded – undo
521 521
 			foreach ( $datas['missing_keys'] as $key_index => $key ) {
522 522
 				$found = self::is_akismet_guest_info_value( $key, $value, $field_id, $datas['name_field_ids'] );
523 523
 				if ( $found ) {
524
-					$datas[ $key ]             = $value;
524
+					$datas[$key]             = $value;
525 525
 					$datas['frm_duplicated'][] = $field_id;
526
-					unset( $datas['missing_keys'][ $key_index ] );
526
+					unset( $datas['missing_keys'][$key_index] );
527 527
 				}
528 528
 			}
529 529
 		}
@@ -569,7 +569,7 @@  discard block
 block discarded – undo
569 569
 
570 570
 			// Send any potentially useful $_SERVER vars, but avoid sending junk we don't need.
571 571
 			if ( $include_value ) {
572
-				$datas[ $key ] = $value;
572
+				$datas[$key] = $value;
573 573
 			}
574 574
 			unset( $key, $value );
575 575
 		}
@@ -586,10 +586,10 @@  discard block
 block discarded – undo
586 586
 	private static function add_comment_content_to_akismet( &$datas, $values ) {
587 587
 		if ( isset( $datas['frm_duplicated'] ) ) {
588 588
 			foreach ( $datas['frm_duplicated'] as $index ) {
589
-				if ( isset( $values['item_meta'][ $index ] ) ) {
590
-					unset( $values['item_meta'][ $index ] );
589
+				if ( isset( $values['item_meta'][$index] ) ) {
590
+					unset( $values['item_meta'][$index] );
591 591
 				} else {
592
-					unset( $values[ $index ] );
592
+					unset( $values[$index] );
593 593
 				}
594 594
 			}
595 595
 			unset( $datas['frm_duplicated'] );
@@ -610,8 +610,8 @@  discard block
 block discarded – undo
610 610
 	private static function skip_adding_values_to_akismet( &$values ) {
611 611
 		$skipped_field_ids = self::get_akismet_skipped_field_ids( $values );
612 612
 		foreach ( $skipped_field_ids as $field_id ) {
613
-			if ( isset( $values['item_meta'][ $field_id ] ) ) {
614
-				unset( $values['item_meta'][ $field_id ] );
613
+			if ( isset( $values['item_meta'][$field_id] ) ) {
614
+				unset( $values['item_meta'][$field_id] );
615 615
 			}
616 616
 		}
617 617
 	}
@@ -667,7 +667,7 @@  discard block
 block discarded – undo
667 667
 
668 668
 			// Convert name array to string.
669 669
 			if ( isset( $value['first'] ) && isset( $value['last'] ) ) {
670
-				$values['item_meta'][ $field_id ] = trim( implode( ' ', $value ) );
670
+				$values['item_meta'][$field_id] = trim( implode( ' ', $value ) );
671 671
 				$values['name_field_ids'][]       = $field_id;
672 672
 				continue;
673 673
 			}
@@ -688,8 +688,8 @@  discard block
 block discarded – undo
688 688
 						continue;
689 689
 					}
690 690
 
691
-					if ( ! isset( $values['item_meta'][ $subsubindex ] ) ) {
692
-						$values['item_meta'][ $subsubindex ] = array();
691
+					if ( ! isset( $values['item_meta'][$subsubindex] ) ) {
692
+						$values['item_meta'][$subsubindex] = array();
693 693
 					}
694 694
 
695 695
 					// Convert name array to string.
@@ -699,11 +699,11 @@  discard block
 block discarded – undo
699 699
 						$values['name_field_ids'][] = $subsubindex;
700 700
 					}
701 701
 
702
-					$values['item_meta'][ $subsubindex ][] = $subsubvalue;
702
+					$values['item_meta'][$subsubindex][] = $subsubvalue;
703 703
 				}
704 704
 			}
705 705
 
706
-			unset( $values['item_meta'][ $field_id ] );
706
+			unset( $values['item_meta'][$field_id] );
707 707
 		}
708 708
 
709 709
 		return $form_ids;
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -112,7 +112,8 @@  discard block
 block discarded – undo
112 112
 
113 113
 		if ( $posted_field->required == '1' && FrmAppHelper::is_empty_value( $value ) ) {
114 114
 			$errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $posted_field, 'blank' );
115
-		} elseif ( $posted_field->type === 'text' && ! isset( $_POST['item_name'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
115
+		} elseif ( $posted_field->type === 'text' && ! isset( $_POST['item_name'] ) ) {
116
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
116 117
 			$_POST['item_name'] = $value;
117 118
 		}
118 119
 
@@ -678,7 +679,8 @@  discard block
 block discarded – undo
678 679
 		// Blacklist check for File field in the old version doesn't contain `form_id`.
679 680
 		$form_ids = isset( $values['form_id'] ) ? array( absint( $values['form_id'] ) ) : array();
680 681
 		foreach ( $values['item_meta'] as $field_id => $value ) {
681
-			if ( ! is_numeric( $field_id ) ) { // Maybe `other`.
682
+			if ( ! is_numeric( $field_id ) ) {
683
+// Maybe `other`.
682 684
 				continue;
683 685
 			}
684 686
 
Please login to merge, or discard this patch.