Completed
Push — master ( a94929...eb6781 )
by Stephanie
17s queued 12s
created
classes/helpers/FrmCSVExportHelper.php 2 patches
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 		self::print_file_headers( $filename );
42 42
 		unset( $filename );
43 43
 
44
-		$comment_count       = FrmDb::get_count(
44
+		$comment_count = FrmDb::get_count(
45 45
 			'frm_item_metas',
46 46
 			array(
47 47
 				'item_id'         => $atts['entry_ids'],
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 	private static function prepare_csv_headings() {
108 108
 		$headings = array();
109 109
 		self::csv_headings( $headings );
110
-		$headings       = apply_filters(
110
+		$headings = apply_filters(
111 111
 			'frm_csv_columns',
112 112
 			$headings,
113 113
 			self::$form_id,
@@ -129,10 +129,10 @@  discard block
 block discarded – undo
129 129
 		$field_headings  = array();
130 130
 		$separate_values = array( 'user_id', 'file', 'data', 'date' );
131 131
 		if ( isset( $col->field_options['separate_value'] ) && $col->field_options['separate_value'] && ! in_array( $col->type, $separate_values, true ) ) {
132
-			$field_headings[ $col->id . '_label' ] = strip_tags( $col->name . ' ' . __( '(label)', 'formidable' ) );
132
+			$field_headings[$col->id . '_label'] = strip_tags( $col->name . ' ' . __( '(label)', 'formidable' ) );
133 133
 		}
134 134
 
135
-		$field_headings[ $col->id ] = strip_tags( $col->name );
135
+		$field_headings[$col->id] = strip_tags( $col->name );
136 136
 		$field_headings             = apply_filters(
137 137
 			'frm_csv_field_columns',
138 138
 			$field_headings,
@@ -151,14 +151,14 @@  discard block
 block discarded – undo
151 151
 		foreach ( self::$fields as $col ) {
152 152
 			if ( self::is_the_child_of_a_repeater( $col ) ) {
153 153
 				$repeater_id                           = $col->field_options['in_section'];
154
-				$headings[ 'repeater' . $repeater_id ] = array(); // set a placeholder to maintain order for repeater fields
154
+				$headings['repeater' . $repeater_id] = array(); // set a placeholder to maintain order for repeater fields
155 155
 
156
-				if ( ! isset( $fields_by_repeater_id[ $repeater_id ] ) ) {
157
-					$fields_by_repeater_id[ $repeater_id ] = array();
156
+				if ( ! isset( $fields_by_repeater_id[$repeater_id] ) ) {
157
+					$fields_by_repeater_id[$repeater_id] = array();
158 158
 					$repeater_ids[]                        = $repeater_id;
159 159
 				}
160 160
 
161
-				$fields_by_repeater_id[ $repeater_id ][] = $col;
161
+				$fields_by_repeater_id[$repeater_id][] = $col;
162 162
 
163 163
 				continue;
164 164
 			}
@@ -177,8 +177,8 @@  discard block
 block discarded – undo
177 177
 				$end    = strpos( $row->meta_value, ':{' );
178 178
 				$length = substr( $row->meta_value, $start, $end - $start );
179 179
 
180
-				if ( $length > $max[ $row->field_id ] ) {
181
-					$max[ $row->field_id ] = $length;
180
+				if ( $length > $max[$row->field_id] ) {
181
+					$max[$row->field_id] = $length;
182 182
 				}
183 183
 			}
184 184
 			unset( $start, $end, $length, $row, $repeater_meta, $where );
@@ -189,17 +189,17 @@  discard block
 block discarded – undo
189 189
 					$repeater_id = str_replace( 'repeater', '', $key );
190 190
 
191 191
 					$repeater_headings = array();
192
-					foreach ( $fields_by_repeater_id[ $repeater_id ] as $col ) {
192
+					foreach ( $fields_by_repeater_id[$repeater_id] as $col ) {
193 193
 						$repeater_headings += self::field_headings( $col );
194 194
 					}
195 195
 
196
-					for ( $i = 0; $i < $max[ $repeater_id ]; $i ++ ) {
196
+					for ( $i = 0; $i < $max[$repeater_id]; $i ++ ) {
197 197
 						foreach ( $repeater_headings as $repeater_key => $repeater_name ) {
198
-							$flat[ $repeater_key . '[' . $i . ']' ] = $repeater_name;
198
+							$flat[$repeater_key . '[' . $i . ']'] = $repeater_name;
199 199
 						}
200 200
 					}
201 201
 				} else {
202
-					$flat[ $key ] = $heading;
202
+					$flat[$key] = $heading;
203 203
 				}
204 204
 			}
205 205
 
@@ -213,9 +213,9 @@  discard block
 block discarded – undo
213 213
 
214 214
 		if ( self::$comment_count ) {
215 215
 			for ( $i = 0; $i < self::$comment_count; $i ++ ) {
216
-				$headings[ 'comment' . $i ]            = __( 'Comment', 'formidable' );
217
-				$headings[ 'comment_user_id' . $i ]    = __( 'Comment User', 'formidable' );
218
-				$headings[ 'comment_created_at' . $i ] = __( 'Comment Date', 'formidable' );
216
+				$headings['comment' . $i]            = __( 'Comment', 'formidable' );
217
+				$headings['comment_user_id' . $i]    = __( 'Comment User', 'formidable' );
218
+				$headings['comment_created_at' . $i] = __( 'Comment Date', 'formidable' );
219 219
 			}
220 220
 			unset( $i );
221 221
 		}
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 
259 259
 	private static function prepare_next_csv_rows( $next_set ) {
260 260
 		// order by parent_item_id so children will be first
261
-		$where   = array(
261
+		$where = array(
262 262
 			'or'             => 1,
263 263
 			'id'             => $next_set,
264 264
 			'parent_item_id' => $next_set,
@@ -303,32 +303,32 @@  discard block
 block discarded – undo
303 303
 					continue;
304 304
 				}
305 305
 
306
-				if ( ! isset( $entries[ self::$entry->parent_item_id ] ) ) {
307
-					$entries[ self::$entry->parent_item_id ]        = new stdClass();
308
-					$entries[ self::$entry->parent_item_id ]->metas = array();
306
+				if ( ! isset( $entries[self::$entry->parent_item_id] ) ) {
307
+					$entries[self::$entry->parent_item_id]        = new stdClass();
308
+					$entries[self::$entry->parent_item_id]->metas = array();
309 309
 				}
310 310
 
311
-				if ( ! isset( $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ] ) ) {
312
-					$entries[ self::$entry->parent_item_id ]->metas[ $meta_id ] = array();
313
-				} elseif ( ! is_array( $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ] ) ) {
311
+				if ( ! isset( $entries[self::$entry->parent_item_id]->metas[$meta_id] ) ) {
312
+					$entries[self::$entry->parent_item_id]->metas[$meta_id] = array();
313
+				} elseif ( ! is_array( $entries[self::$entry->parent_item_id]->metas[$meta_id] ) ) {
314 314
 					// if the data is here, it should be an array but if this field has collected data
315 315
 					// both while inside and outside of the repeating section, it's possible this is a string
316
-					$entries[ self::$entry->parent_item_id ]->metas[ $meta_id ] = (array) $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ];
316
+					$entries[self::$entry->parent_item_id]->metas[$meta_id] = (array) $entries[self::$entry->parent_item_id]->metas[$meta_id];
317 317
 				}
318 318
 
319 319
 				//add the repeated values
320
-				$entries[ self::$entry->parent_item_id ]->metas[ $meta_id ][] = $meta_value;
320
+				$entries[self::$entry->parent_item_id]->metas[$meta_id][] = $meta_value;
321 321
 			}
322 322
 
323 323
 			self::$entry->metas                              = self::fill_missing_repeater_metas( self::$entry->metas, $entries );
324
-			$entries[ self::$entry->parent_item_id ]->metas += self::$entry->metas;
324
+			$entries[self::$entry->parent_item_id]->metas += self::$entry->metas;
325 325
 		}
326 326
 
327 327
 		// add the embedded form id
328
-		if ( ! isset( $entries[ self::$entry->parent_item_id ]->embedded_fields ) ) {
329
-			$entries[ self::$entry->parent_item_id ]->embedded_fields = array();
328
+		if ( ! isset( $entries[self::$entry->parent_item_id]->embedded_fields ) ) {
329
+			$entries[self::$entry->parent_item_id]->embedded_fields = array();
330 330
 		}
331
-		$entries[ self::$entry->parent_item_id ]->embedded_fields[ self::$entry->id ] = self::$entry->form_id;
331
+		$entries[self::$entry->parent_item_id]->embedded_fields[self::$entry->id] = self::$entry->form_id;
332 332
 	}
333 333
 
334 334
 	/**
@@ -349,14 +349,14 @@  discard block
 block discarded – undo
349 349
 		}
350 350
 
351 351
 		$repeater_id = $field->field_options['in_section'];
352
-		if ( ! isset( self::$fields_by_repeater_id[ $repeater_id ] ) ) {
352
+		if ( ! isset( self::$fields_by_repeater_id[$repeater_id] ) ) {
353 353
 			return $metas;
354 354
 		}
355 355
 
356
-		foreach ( self::$fields_by_repeater_id[ $repeater_id ] as $repeater_child ) {
357
-			if ( ! isset( $metas[ $repeater_child->id ] ) ) {
358
-				$metas[ $repeater_child->id ]                                            = '';
359
-				$entries[ self::$entry->parent_item_id ]->metas[ $repeater_child->id ][] = '';
356
+		foreach ( self::$fields_by_repeater_id[$repeater_id] as $repeater_child ) {
357
+			if ( ! isset( $metas[$repeater_child->id] ) ) {
358
+				$metas[$repeater_child->id]                                            = '';
359
+				$entries[self::$entry->parent_item_id]->metas[$repeater_child->id][] = '';
360 360
 			}
361 361
 		}
362 362
 
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
 
376 376
 	private static function add_field_values_to_csv( &$row ) {
377 377
 		foreach ( self::$fields as $col ) {
378
-			$field_value = isset( self::$entry->metas[ $col->id ] ) ? self::$entry->metas[ $col->id ] : false;
378
+			$field_value = isset( self::$entry->metas[$col->id] ) ? self::$entry->metas[$col->id] : false;
379 379
 
380 380
 			FrmAppHelper::unserialize_or_decode( $field_value );
381 381
 			self::add_array_values_to_columns( $row, compact( 'col', 'field_value' ) );
@@ -400,15 +400,15 @@  discard block
 block discarded – undo
400 400
 						'show_icon'         => false,
401 401
 						'entry_id'          => self::$entry->id,
402 402
 						'sep'               => self::$separator,
403
-						'embedded_field_id' => ( isset( self::$entry->embedded_fields ) && isset( self::$entry->embedded_fields[ self::$entry->id ] ) ) ? 'form' . self::$entry->embedded_fields[ self::$entry->id ] : 0,
403
+						'embedded_field_id' => ( isset( self::$entry->embedded_fields ) && isset( self::$entry->embedded_fields[self::$entry->id] ) ) ? 'form' . self::$entry->embedded_fields[self::$entry->id] : 0,
404 404
 					)
405 405
 				);
406 406
 
407
-				$row[ $col->id . '_label' ] = $sep_value;
407
+				$row[$col->id . '_label'] = $sep_value;
408 408
 				unset( $sep_value );
409 409
 			}
410 410
 
411
-			$row[ $col->id ] = $field_value;
411
+			$row[$col->id] = $field_value;
412 412
 
413 413
 			unset( $col, $field_value );
414 414
 		}
@@ -424,8 +424,8 @@  discard block
 block discarded – undo
424 424
 					// This is combo field inside repeater. The heading key has this format: [86_first[0]].
425 425
 					foreach ( $sub_value as $sub_key => $sub_sub_value ) {
426 426
 						$column_key = $atts['col']->id . '_' . $sub_key . '[' . $key . ']';
427
-						if ( ! is_numeric( $sub_key ) && isset( self::$headings[ $column_key ] ) ) {
428
-							$row[ $column_key ] = $sub_sub_value;
427
+						if ( ! is_numeric( $sub_key ) && isset( self::$headings[$column_key] ) ) {
428
+							$row[$column_key] = $sub_sub_value;
429 429
 						}
430 430
 					}
431 431
 
@@ -433,8 +433,8 @@  discard block
 block discarded – undo
433 433
 				}
434 434
 
435 435
 				$column_key = $atts['col']->id . '_' . $key;
436
-				if ( ! is_numeric( $key ) && isset( self::$headings[ $column_key ] ) ) {
437
-					$row[ $column_key ] = $sub_value;
436
+				if ( ! is_numeric( $key ) && isset( self::$headings[$column_key] ) ) {
437
+					$row[$column_key] = $sub_value;
438 438
 				}
439 439
 			}
440 440
 		}
@@ -458,18 +458,18 @@  discard block
 block discarded – undo
458 458
 		$sep = '';
459 459
 
460 460
 		foreach ( self::$headings as $k => $heading ) {
461
-			if ( isset( $rows[ $k ] ) ) {
462
-				$row = $rows[ $k ];
461
+			if ( isset( $rows[$k] ) ) {
462
+				$row = $rows[$k];
463 463
 			} else {
464 464
 				$row = '';
465 465
 				// array indexed data is not at $rows[ $k ]
466
-				if ( $k[ strlen( $k ) - 1 ] === ']' ) {
466
+				if ( $k[strlen( $k ) - 1] === ']' ) {
467 467
 					$start = strrpos( $k, '[' );
468 468
 					$key   = substr( $k, 0, $start ++ );
469 469
 					$index = substr( $k, $start, strlen( $k ) - 1 - $start );
470 470
 
471
-					if ( isset( $rows[ $key ] ) && isset( $rows[ $key ][ $index ] ) ) {
472
-						$row = $rows[ $key ][ $index ];
471
+					if ( isset( $rows[$key] ) && isset( $rows[$key][$index] ) ) {
472
+						$row = $rows[$key][$index];
473 473
 					}
474 474
 
475 475
 					unset( $start, $key, $index );
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -122,7 +122,8 @@
 block discarded – undo
122 122
 
123 123
 	private static function field_headings( $col ) {
124 124
 		$field_type_obj = FrmFieldFactory::get_field_factory( $col );
125
-		if ( ! empty( $field_type_obj->is_combo_field ) ) { // This is combo field.
125
+		if ( ! empty( $field_type_obj->is_combo_field ) ) {
126
+// This is combo field.
126 127
 			return $field_type_obj->get_export_headings();
127 128
 		}
128 129
 
Please login to merge, or discard this patch.
classes/models/FrmAntiSpam.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -213,10 +213,10 @@
 block discarded – undo
213 213
 			return false;
214 214
 		}
215 215
 		$form_params = $frm_vars['form_params'];
216
-		if ( ! isset( $form_params[ $this->form_id ] ) ) {
216
+		if ( ! isset( $form_params[$this->form_id] ) ) {
217 217
 			return false;
218 218
 		}
219
-		$this_form_params = $form_params[ $this->form_id ];
219
+		$this_form_params = $form_params[$this->form_id];
220 220
 		return ! empty( $this_form_params['action'] ) && 'update' === $this_form_params['action'];
221 221
 	}
222 222
 
Please login to merge, or discard this patch.
classes/models/FrmHoneypot.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
 	private function check_honeypot_setting() {
49 49
 		$form = $this->get_form();
50 50
 		$key  = $this->get_option_key();
51
-		return $form->options[ $key ];
51
+		return $form->options[$key];
52 52
 	}
53 53
 
54 54
 	/**
Please login to merge, or discard this patch.
classes/models/FrmValidate.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
 	protected function is_option_on() {
39 39
 		$form = $this->get_form();
40 40
 		$key  = $this->get_option_key();
41
-		return ! empty( $form->options[ $key ] ) && 'off' !== $form->options[ $key ];
41
+		return ! empty( $form->options[$key] ) && 'off' !== $form->options[$key];
42 42
 	}
43 43
 
44 44
 	/**
Please login to merge, or discard this patch.
classes/models/fields/FrmFieldName.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -46,19 +46,19 @@  discard block
 block discarded – undo
46 46
 		$result = array();
47 47
 
48 48
 		foreach ( $names as $name ) {
49
-			if ( empty( $this->sub_fields[ $name ] ) ) {
49
+			if ( empty( $this->sub_fields[$name] ) ) {
50 50
 				continue;
51 51
 			}
52 52
 
53
-			if ( ! isset( $this->sub_fields[ $name ]['wrapper_classes'] ) ) {
54
-				$this->sub_fields[ $name ]['wrapper_classes'] = $col_class;
55
-			} elseif ( is_array( $this->sub_fields[ $name ]['wrapper_classes'] ) ) {
56
-				$this->sub_fields[ $name ]['wrapper_classes'] = implode( ' ', $this->sub_fields[ $name ]['wrapper_classes'] ) . ' ' . $col_class;
53
+			if ( ! isset( $this->sub_fields[$name]['wrapper_classes'] ) ) {
54
+				$this->sub_fields[$name]['wrapper_classes'] = $col_class;
55
+			} elseif ( is_array( $this->sub_fields[$name]['wrapper_classes'] ) ) {
56
+				$this->sub_fields[$name]['wrapper_classes'] = implode( ' ', $this->sub_fields[$name]['wrapper_classes'] ) . ' ' . $col_class;
57 57
 			} else {
58
-				$this->sub_fields[ $name ]['wrapper_classes'] .= ' ' . $col_class;
58
+				$this->sub_fields[$name]['wrapper_classes'] .= ' ' . $col_class;
59 59
 			}
60 60
 
61
-			$result[ $name ] = $this->sub_fields[ $name ];
61
+			$result[$name] = $this->sub_fields[$name];
62 62
 		}
63 63
 
64 64
 		return $result;
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 
90 90
 		// Default desc.
91 91
 		foreach ( $this->sub_fields as $name => $sub_field ) {
92
-			$extra_options[ $name . '_desc' ] = $sub_field['label'];
92
+			$extra_options[$name . '_desc'] = $sub_field['label'];
93 93
 		}
94 94
 
95 95
 		return $extra_options;
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 		$name_layout = $this->get_name_layout();
126 126
 
127 127
 		if ( ! empty( $atts['show'] ) ) {
128
-			return isset( $value[ $atts['show'] ] ) ? $value[ $atts['show'] ] : '';
128
+			return isset( $value[$atts['show']] ) ? $value[$atts['show']] : '';
129 129
 		}
130 130
 
131 131
 		$value = wp_parse_args(
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
 			$args['sub_fields'] = $this->sub_fields;
199 199
 
200 200
 			foreach ( $hidden_fields as $name => $hidden_field ) {
201
-				$args['sub_fields'][ $name ]['wrapper_classes'] .= ' frm_hidden';
201
+				$args['sub_fields'][$name]['wrapper_classes'] .= ' frm_hidden';
202 202
 			}
203 203
 		}
204 204
 	}
Please login to merge, or discard this patch.
classes/models/FrmEntry.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 			$metas       = FrmEntryMeta::get_entry_meta_info( $entry_exist );
78 78
 			$field_metas = array();
79 79
 			foreach ( $metas as $meta ) {
80
-				$field_metas[ $meta->field_id ] = $meta->meta_value;
80
+				$field_metas[$meta->field_id] = $meta->meta_value;
81 81
 			}
82 82
 
83 83
 			$filtered_vals = array_filter( $values['item_meta'] );
@@ -131,10 +131,10 @@  discard block
 block discarded – undo
131 131
 		$reduced = array();
132 132
 		foreach ( $filter_vals as $field_id => $value ) {
133 133
 			$field                = FrmFieldFactory::get_field_object( $field_id );
134
-			$reduced[ $field_id ] = $field->get_value_to_save( $value, array( 'entry_id' => $entry_id ) );
135
-			$reduced[ $field_id ] = $field->set_value_before_save( $reduced[ $field_id ] );
136
-			if ( '' === $reduced[ $field_id ] || ( is_array( $reduced[ $field_id ] ) && 0 === count( $reduced[ $field_id ] ) ) ) {
137
-				unset( $reduced[ $field_id ] );
134
+			$reduced[$field_id] = $field->get_value_to_save( $value, array( 'entry_id' => $entry_id ) );
135
+			$reduced[$field_id] = $field->set_value_before_save( $reduced[$field_id] );
136
+			if ( '' === $reduced[$field_id] || ( is_array( $reduced[$field_id] ) && 0 === count( $reduced[$field_id] ) ) ) {
137
+				unset( $reduced[$field_id] );
138 138
 			}
139 139
 		}
140 140
 		return $reduced;
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
 		$query = "SELECT it.*, fr.name as form_name, fr.form_key as form_key FROM {$wpdb->prefix}frm_items it
328 328
                   LEFT OUTER JOIN {$wpdb->prefix}frm_forms fr ON it.form_id=fr.id WHERE ";
329 329
 
330
-		$query      .= is_numeric( $id ) ? 'it.id=%d' : 'it.item_key=%s';
330
+		$query .= is_numeric( $id ) ? 'it.id=%d' : 'it.item_key=%s';
331 331
 		$query_args = array( $id );
332 332
 		$query      = $wpdb->prepare( $query, $query_args ); // WPCS: unprepared SQL ok.
333 333
 
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
 	private static function prepare_entries( &$entries ) {
373 373
 		foreach ( $entries as $k => $entry ) {
374 374
 			self::prepare_entry( $entry );
375
-			$entries[ $k ] = $entry;
375
+			$entries[$k] = $entry;
376 376
 		}
377 377
 	}
378 378
 
@@ -397,20 +397,20 @@  discard block
 block discarded – undo
397 397
 		foreach ( $metas as $meta_val ) {
398 398
 			if ( $meta_val->item_id == $entry->id ) {
399 399
 				FrmAppHelper::unserialize_or_decode( $meta_val->meta_value );
400
-				$entry->metas[ $meta_val->field_id ] = $meta_val->meta_value;
400
+				$entry->metas[$meta_val->field_id] = $meta_val->meta_value;
401 401
 				if ( $include_key ) {
402
-					$entry->metas[ $meta_val->field_key ] = $entry->metas[ $meta_val->field_id ];
402
+					$entry->metas[$meta_val->field_key] = $entry->metas[$meta_val->field_id];
403 403
 				}
404 404
 				continue;
405 405
 			}
406 406
 
407 407
 			// include sub entries in an array
408
-			if ( ! isset( $entry->metas[ $meta_val->field_id ] ) ) {
409
-				$entry->metas[ $meta_val->field_id ] = array();
408
+			if ( ! isset( $entry->metas[$meta_val->field_id] ) ) {
409
+				$entry->metas[$meta_val->field_id] = array();
410 410
 			}
411 411
 
412 412
 			FrmAppHelper::unserialize_or_decode( $meta_val->meta_value );
413
-			$entry->metas[ $meta_val->field_id ][] = $meta_val->meta_value;
413
+			$entry->metas[$meta_val->field_id][] = $meta_val->meta_value;
414 414
 
415 415
 			unset( $meta_val );
416 416
 		}
@@ -457,13 +457,13 @@  discard block
 block discarded – undo
457 457
 
458 458
 			if ( $inc_form ) {
459 459
 				$fields = 'it.*, fr.name as form_name,fr.form_key as form_key';
460
-				$table  .= 'LEFT OUTER JOIN ' . $wpdb->prefix . 'frm_forms fr ON it.form_id=fr.id ';
460
+				$table .= 'LEFT OUTER JOIN ' . $wpdb->prefix . 'frm_forms fr ON it.form_id=fr.id ';
461 461
 			}
462 462
 
463 463
 			if ( preg_match( '/ meta_([0-9]+)/', $order_by, $order_matches ) ) {
464 464
 				// sort by a requested field
465 465
 				$field_id = (int) $order_matches[1];
466
-				$fields   .= ', (SELECT meta_value FROM ' . $wpdb->prefix . 'frm_item_metas WHERE field_id = ' . $field_id . ' AND item_id = it.id) as meta_' . $field_id;
466
+				$fields .= ', (SELECT meta_value FROM ' . $wpdb->prefix . 'frm_item_metas WHERE field_id = ' . $field_id . ' AND item_id = it.id) as meta_' . $field_id;
467 467
 				unset( $order_matches, $field_id );
468 468
 			}
469 469
 
@@ -503,16 +503,16 @@  discard block
 block discarded – undo
503 503
 		}
504 504
 
505 505
 		foreach ( $metas as $m_key => $meta_val ) {
506
-			if ( ! isset( $entries[ $meta_val->item_id ] ) ) {
506
+			if ( ! isset( $entries[$meta_val->item_id] ) ) {
507 507
 				continue;
508 508
 			}
509 509
 
510
-			if ( ! isset( $entries[ $meta_val->item_id ]->metas ) ) {
511
-				$entries[ $meta_val->item_id ]->metas = array();
510
+			if ( ! isset( $entries[$meta_val->item_id]->metas ) ) {
511
+				$entries[$meta_val->item_id]->metas = array();
512 512
 			}
513 513
 
514 514
 			FrmAppHelper::unserialize_or_decode( $meta_val->meta_value );
515
-			$entries[ $meta_val->item_id ]->metas[ $meta_val->field_id ] = $meta_val->meta_value;
515
+			$entries[$meta_val->item_id]->metas[$meta_val->field_id] = $meta_val->meta_value;
516 516
 			unset( $m_key, $meta_val );
517 517
 		}
518 518
 
@@ -670,7 +670,7 @@  discard block
 block discarded – undo
670 670
 	}
671 671
 
672 672
 	private static function get_entry_value( $values, $name, $default ) {
673
-		return isset( $values[ $name ] ) ? $values[ $name ] : $default;
673
+		return isset( $values[$name] ) ? $values[$name] : $default;
674 674
 	}
675 675
 
676 676
 	/**
Please login to merge, or discard this patch.
classes/helpers/FrmAppHelper.php 1 patch
Spacing   +69 added lines, -69 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
 
@@ -412,10 +412,10 @@  discard block
 block discarded – undo
412 412
 
413 413
 		if ( $src == 'get' ) {
414 414
 			// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
415
-			$value = isset( $_POST[ $param ] ) ? wp_unslash( $_POST[ $param ] ) : ( isset( $_GET[ $param ] ) ? wp_unslash( $_GET[ $param ] ) : $default );
416
-			if ( ! isset( $_POST[ $param ] ) && isset( $_GET[ $param ] ) && ! is_array( $value ) ) {
415
+			$value = isset( $_POST[$param] ) ? wp_unslash( $_POST[$param] ) : ( isset( $_GET[$param] ) ? wp_unslash( $_GET[$param] ) : $default );
416
+			if ( ! isset( $_POST[$param] ) && isset( $_GET[$param] ) && ! is_array( $value ) ) {
417 417
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
418
-				$value = htmlspecialchars_decode( wp_unslash( $_GET[ $param ] ) );
418
+				$value = htmlspecialchars_decode( wp_unslash( $_GET[$param] ) );
419 419
 			}
420 420
 			self::sanitize_value( $sanitize, $value );
421 421
 		} else {
@@ -436,7 +436,7 @@  discard block
 block discarded – undo
436 436
 				}
437 437
 
438 438
 				$p     = trim( $p, ']' );
439
-				$value = isset( $value[ $p ] ) ? $value[ $p ] : $default;
439
+				$value = isset( $value[$p] ) ? $value[$p] : $default;
440 440
 			}
441 441
 		}
442 442
 
@@ -492,26 +492,26 @@  discard block
 block discarded – undo
492 492
 			'sanitize' => 'sanitize_text_field',
493 493
 			'serialized' => false,
494 494
 		);
495
-		$args     = wp_parse_args( $args, $defaults );
495
+		$args = wp_parse_args( $args, $defaults );
496 496
 
497 497
 		$value = $args['default'];
498 498
 		if ( $args['type'] == 'get' ) {
499
-			if ( $_GET && isset( $_GET[ $args['param'] ] ) ) {
499
+			if ( $_GET && isset( $_GET[$args['param']] ) ) {
500 500
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
501
-				$value = wp_unslash( $_GET[ $args['param'] ] );
501
+				$value = wp_unslash( $_GET[$args['param']] );
502 502
 			}
503 503
 		} elseif ( $args['type'] == 'post' ) {
504
-			if ( isset( $_POST[ $args['param'] ] ) ) {
504
+			if ( isset( $_POST[$args['param']] ) ) {
505 505
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
506
-				$value = wp_unslash( $_POST[ $args['param'] ] );
506
+				$value = wp_unslash( $_POST[$args['param']] );
507 507
 				if ( $args['serialized'] === true && is_serialized_string( $value ) && is_serialized( $value ) ) {
508 508
 					self::unserialize_or_decode( $value );
509 509
 				}
510 510
 			}
511 511
 		} else {
512
-			if ( isset( $_REQUEST[ $args['param'] ] ) ) {
512
+			if ( isset( $_REQUEST[$args['param']] ) ) {
513 513
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
514
-				$value = wp_unslash( $_REQUEST[ $args['param'] ] );
514
+				$value = wp_unslash( $_REQUEST[$args['param']] );
515 515
 			}
516 516
 		}
517 517
 
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
 			if ( is_array( $value ) ) {
544 544
 				$temp_values = $value;
545 545
 				foreach ( $temp_values as $k => $v ) {
546
-					self::sanitize_value( $sanitize, $value[ $k ] );
546
+					self::sanitize_value( $sanitize, $value[$k] );
547 547
 				}
548 548
 			} else {
549 549
 				$value = call_user_func( $sanitize, $value );
@@ -554,8 +554,8 @@  discard block
 block discarded – undo
554 554
 	public static function sanitize_request( $sanitize_method, &$values ) {
555 555
 		$temp_values = $values;
556 556
 		foreach ( $temp_values as $k => $val ) {
557
-			if ( isset( $sanitize_method[ $k ] ) ) {
558
-				$values[ $k ] = call_user_func( $sanitize_method[ $k ], $val );
557
+			if ( isset( $sanitize_method[$k] ) ) {
558
+				$values[$k] = call_user_func( $sanitize_method[$k], $val );
559 559
 			}
560 560
 		}
561 561
 	}
@@ -578,7 +578,7 @@  discard block
 block discarded – undo
578 578
 		if ( is_array( $value ) ) {
579 579
 			$temp_values = $value;
580 580
 			foreach ( $temp_values as $k => $v ) {
581
-				self::decode_specialchars( $value[ $k ] );
581
+				self::decode_specialchars( $value[$k] );
582 582
 			}
583 583
 		} else {
584 584
 			self::decode_amp( $value );
@@ -655,7 +655,7 @@  discard block
 block discarded – undo
655 655
 			$allowed_html = $html;
656 656
 		} elseif ( ! empty( $allowed ) ) {
657 657
 			foreach ( (array) $allowed as $a ) {
658
-				$allowed_html[ $a ] = isset( $html[ $a ] ) ? $html[ $a ] : array();
658
+				$allowed_html[$a] = isset( $html[$a] ) ? $html[$a] : array();
659 659
 			}
660 660
 		}
661 661
 
@@ -817,8 +817,8 @@  discard block
 block discarded – undo
817 817
 		}
818 818
 
819 819
 		global $wp_query;
820
-		if ( isset( $wp_query->query_vars[ $param ] ) ) {
821
-			$value = $wp_query->query_vars[ $param ];
820
+		if ( isset( $wp_query->query_vars[$param] ) ) {
821
+			$value = $wp_query->query_vars[$param];
822 822
 		}
823 823
 
824 824
 		return $value;
@@ -996,7 +996,7 @@  discard block
 block discarded – undo
996 996
 				'new_file_path' => self::plugin_path() . '/js',
997 997
 			)
998 998
 		);
999
-		$new_file  = new FrmCreateFile( $file_atts );
999
+		$new_file = new FrmCreateFile( $file_atts );
1000 1000
 
1001 1001
 		$files = array(
1002 1002
 			self::plugin_path() . '/js/jquery/jquery.placeholder.min.js',
@@ -1388,8 +1388,8 @@  discard block
 block discarded – undo
1388 1388
 			return $error;
1389 1389
 		}
1390 1390
 
1391
-		$nonce_value = ( $_REQUEST && isset( $_REQUEST[ $nonce_name ] ) ) ? sanitize_text_field( wp_unslash( $_REQUEST[ $nonce_name ] ) ) : '';
1392
-		if ( $_REQUEST && ( ! isset( $_REQUEST[ $nonce_name ] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) {
1391
+		$nonce_value = ( $_REQUEST && isset( $_REQUEST[$nonce_name] ) ) ? sanitize_text_field( wp_unslash( $_REQUEST[$nonce_name] ) ) : '';
1392
+		if ( $_REQUEST && ( ! isset( $_REQUEST[$nonce_name] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) {
1393 1393
 			$frm_settings = self::get_settings();
1394 1394
 			$error        = $frm_settings->admin_permission;
1395 1395
 		}
@@ -1424,7 +1424,7 @@  discard block
 block discarded – undo
1424 1424
 			} else {
1425 1425
 				foreach ( $value as $k => $v ) {
1426 1426
 					if ( ! is_array( $v ) ) {
1427
-						$value[ $k ] = call_user_func( $original_function, $v );
1427
+						$value[$k] = call_user_func( $original_function, $v );
1428 1428
 					}
1429 1429
 				}
1430 1430
 			}
@@ -1449,7 +1449,7 @@  discard block
 block discarded – undo
1449 1449
 				$return = array_merge( $return, self::array_flatten( $value, $keys ) );
1450 1450
 			} else {
1451 1451
 				if ( $keys == 'keep' ) {
1452
-					$return[ $key ] = $value;
1452
+					$return[$key] = $value;
1453 1453
 				} else {
1454 1454
 					$return[] = $value;
1455 1455
 				}
@@ -1513,11 +1513,11 @@  discard block
 block discarded – undo
1513 1513
 		}
1514 1514
 
1515 1515
 		$ver = $default;
1516
-		if ( ! isset( $wp_scripts->registered[ $handle ] ) ) {
1516
+		if ( ! isset( $wp_scripts->registered[$handle] ) ) {
1517 1517
 			return $ver;
1518 1518
 		}
1519 1519
 
1520
-		$query = $wp_scripts->registered[ $handle ];
1520
+		$query = $wp_scripts->registered[$handle];
1521 1521
 		if ( is_object( $query ) && ! empty( $query->ver ) ) {
1522 1522
 			$ver = $query->ver;
1523 1523
 		}
@@ -1675,7 +1675,7 @@  discard block
 block discarded – undo
1675 1675
 
1676 1676
 		foreach ( array( 'name', 'description' ) as $var ) {
1677 1677
 			$default_val    = isset( $record->{$var} ) ? $record->{$var} : '';
1678
-			$values[ $var ] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' );
1678
+			$values[$var] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' );
1679 1679
 			unset( $var, $default_val );
1680 1680
 		}
1681 1681
 
@@ -1733,9 +1733,9 @@  discard block
 block discarded – undo
1733 1733
 			}
1734 1734
 		}
1735 1735
 
1736
-		$field_type = isset( $post_values['field_options'][ 'type_' . $field->id ] ) ? $post_values['field_options'][ 'type_' . $field->id ] : $field->type;
1737
-		if ( isset( $post_values['item_meta'][ $field->id ] ) ) {
1738
-			$new_value = $post_values['item_meta'][ $field->id ];
1736
+		$field_type = isset( $post_values['field_options']['type_' . $field->id] ) ? $post_values['field_options']['type_' . $field->id] : $field->type;
1737
+		if ( isset( $post_values['item_meta'][$field->id] ) ) {
1738
+			$new_value = $post_values['item_meta'][$field->id];
1739 1739
 			self::unserialize_or_decode( $new_value );
1740 1740
 		} else {
1741 1741
 			$new_value = $meta_value;
@@ -1756,7 +1756,7 @@  discard block
 block discarded – undo
1756 1756
 
1757 1757
 		$field_array = array_merge( (array) $field->field_options, $field_array );
1758 1758
 
1759
-		$values['fields'][ $field->id ] = $field_array;
1759
+		$values['fields'][$field->id] = $field_array;
1760 1760
 	}
1761 1761
 
1762 1762
 	/**
@@ -1803,11 +1803,11 @@  discard block
 block discarded – undo
1803 1803
 		}
1804 1804
 
1805 1805
 		foreach ( $form->options as $opt => $value ) {
1806
-			if ( isset( $post_values[ $opt ] ) ) {
1807
-				$values[ $opt ] = $post_values[ $opt ];
1808
-				self::unserialize_or_decode( $values[ $opt ] );
1806
+			if ( isset( $post_values[$opt] ) ) {
1807
+				$values[$opt] = $post_values[$opt];
1808
+				self::unserialize_or_decode( $values[$opt] );
1809 1809
 			} else {
1810
-				$values[ $opt ] = $value;
1810
+				$values[$opt] = $value;
1811 1811
 			}
1812 1812
 		}
1813 1813
 
@@ -1821,8 +1821,8 @@  discard block
 block discarded – undo
1821 1821
 		$form_defaults = FrmFormsHelper::get_default_opts();
1822 1822
 
1823 1823
 		foreach ( $form_defaults as $opt => $default ) {
1824
-			if ( ! isset( $values[ $opt ] ) || $values[ $opt ] == '' ) {
1825
-				$values[ $opt ] = ( $post_values && isset( $post_values['options'][ $opt ] ) ) ? $post_values['options'][ $opt ] : $default;
1824
+			if ( ! isset( $values[$opt] ) || $values[$opt] == '' ) {
1825
+				$values[$opt] = ( $post_values && isset( $post_values['options'][$opt] ) ) ? $post_values['options'][$opt] : $default;
1826 1826
 			}
1827 1827
 
1828 1828
 			unset( $opt, $default );
@@ -1833,8 +1833,8 @@  discard block
 block discarded – undo
1833 1833
 		}
1834 1834
 
1835 1835
 		foreach ( array( 'before', 'after', 'submit' ) as $h ) {
1836
-			if ( ! isset( $values[ $h . '_html' ] ) ) {
1837
-				$values[ $h . '_html' ] = ( isset( $post_values['options'][ $h . '_html' ] ) ? $post_values['options'][ $h . '_html' ] : FrmFormsHelper::get_default_html( $h ) );
1836
+			if ( ! isset( $values[$h . '_html'] ) ) {
1837
+				$values[$h . '_html'] = ( isset( $post_values['options'][$h . '_html'] ) ? $post_values['options'][$h . '_html'] : FrmFormsHelper::get_default_html( $h ) );
1838 1838
 			}
1839 1839
 			unset( $h );
1840 1840
 		}
@@ -1986,25 +1986,25 @@  discard block
 block discarded – undo
1986 1986
 		if ( ! is_numeric( $levels ) ) {
1987 1987
 			// Show time in specified unit.
1988 1988
 			$levels = self::get_unit( $levels );
1989
-			if ( isset( $time_strings[ $levels ] ) ) {
1989
+			if ( isset( $time_strings[$levels] ) ) {
1990 1990
 				$diff = array(
1991 1991
 					$levels => self::time_format( $levels, $diff ),
1992 1992
 				);
1993 1993
 				$time_strings = array(
1994
-					$levels => $time_strings[ $levels ],
1994
+					$levels => $time_strings[$levels],
1995 1995
 				);
1996 1996
 			}
1997 1997
 			$levels = 1;
1998 1998
 		}
1999 1999
 
2000 2000
 		foreach ( $time_strings as $k => $v ) {
2001
-			if ( isset( $diff[ $k ] ) && $diff[ $k ] ) {
2002
-				$time_strings[ $k ] = $diff[ $k ] . ' ' . ( $diff[ $k ] > 1 ? $v[1] : $v[0] );
2003
-			} elseif ( isset( $diff[ $k ] ) && count( $time_strings ) === 1 ) {
2001
+			if ( isset( $diff[$k] ) && $diff[$k] ) {
2002
+				$time_strings[$k] = $diff[$k] . ' ' . ( $diff[$k] > 1 ? $v[1] : $v[0] );
2003
+			} elseif ( isset( $diff[$k] ) && count( $time_strings ) === 1 ) {
2004 2004
 				// Account for 0.
2005
-				$time_strings[ $k ] = $diff[ $k ] . ' ' . $v[1];
2005
+				$time_strings[$k] = $diff[$k] . ' ' . $v[1];
2006 2006
 			} else {
2007
-				unset( $time_strings[ $k ] );
2007
+				unset( $time_strings[$k] );
2008 2008
 			}
2009 2009
 		}
2010 2010
 
@@ -2023,8 +2023,8 @@  discard block
 block discarded – undo
2023 2023
 			'y' => 'y',
2024 2024
 			'd' => 'days',
2025 2025
 		);
2026
-		if ( isset( $return[ $unit ] ) ) {
2027
-			return $diff[ $return[ $unit ] ];
2026
+		if ( isset( $return[$unit] ) ) {
2027
+			return $diff[$return[$unit]];
2028 2028
 		}
2029 2029
 
2030 2030
 		$total = $diff['days'] * self::convert_time( 'd', $unit );
@@ -2032,11 +2032,11 @@  discard block
 block discarded – undo
2032 2032
 		$times = array( 'h', 'i', 's' );
2033 2033
 
2034 2034
 		foreach ( $times as $time ) {
2035
-			if ( ! isset( $diff[ $time ] ) ) {
2035
+			if ( ! isset( $diff[$time] ) ) {
2036 2036
 				continue;
2037 2037
 			}
2038 2038
 
2039
-			$total += $diff[ $time ] * self::convert_time( $time, $unit );
2039
+			$total += $diff[$time] * self::convert_time( $time, $unit );
2040 2040
 		}
2041 2041
 
2042 2042
 		return floor( $total );
@@ -2056,7 +2056,7 @@  discard block
 block discarded – undo
2056 2056
 			'y' => DAY_IN_SECONDS * 365.25,
2057 2057
 		);
2058 2058
 
2059
-		return $convert[ $from ] / $convert[ $to ];
2059
+		return $convert[$from] / $convert[$to];
2060 2060
 	}
2061 2061
 
2062 2062
 	/**
@@ -2064,7 +2064,7 @@  discard block
 block discarded – undo
2064 2064
 	 */
2065 2065
 	private static function get_unit( $unit ) {
2066 2066
 		$units = self::get_time_strings();
2067
-		if ( isset( $units[ $unit ] ) || is_numeric( $unit ) ) {
2067
+		if ( isset( $units[$unit] ) || is_numeric( $unit ) ) {
2068 2068
 			return $unit;
2069 2069
 		}
2070 2070
 
@@ -2175,17 +2175,17 @@  discard block
 block discarded – undo
2175 2175
 
2176 2176
 					case 1:
2177 2177
 						$l2 = $name;
2178
-						self::add_value_to_array( $name, $l2, $this_val, $vars[ $l1 ] );
2178
+						self::add_value_to_array( $name, $l2, $this_val, $vars[$l1] );
2179 2179
 						break;
2180 2180
 
2181 2181
 					case 2:
2182 2182
 						$l3 = $name;
2183
-						self::add_value_to_array( $name, $l3, $this_val, $vars[ $l1 ][ $l2 ] );
2183
+						self::add_value_to_array( $name, $l3, $this_val, $vars[$l1][$l2] );
2184 2184
 						break;
2185 2185
 
2186 2186
 					case 3:
2187 2187
 						$l4 = $name;
2188
-						self::add_value_to_array( $name, $l4, $this_val, $vars[ $l1 ][ $l2 ][ $l3 ] );
2188
+						self::add_value_to_array( $name, $l4, $this_val, $vars[$l1][$l2][$l3] );
2189 2189
 				}
2190 2190
 
2191 2191
 				unset( $this_val, $n );
@@ -2204,8 +2204,8 @@  discard block
 block discarded – undo
2204 2204
 	public static function add_value_to_array( $name, $l1, $val, &$vars ) {
2205 2205
 		if ( $name == '' ) {
2206 2206
 			$vars[] = $val;
2207
-		} elseif ( ! isset( $vars[ $l1 ] ) ) {
2208
-			$vars[ $l1 ] = $val;
2207
+		} elseif ( ! isset( $vars[$l1] ) ) {
2208
+			$vars[$l1] = $val;
2209 2209
 		}
2210 2210
 	}
2211 2211
 
@@ -2221,7 +2221,7 @@  discard block
 block discarded – undo
2221 2221
 			'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() ) ),
2222 2222
 		);
2223 2223
 
2224
-		if ( ! isset( $tooltips[ $name ] ) ) {
2224
+		if ( ! isset( $tooltips[$name] ) ) {
2225 2225
 			return;
2226 2226
 		}
2227 2227
 
@@ -2231,7 +2231,7 @@  discard block
 block discarded – undo
2231 2231
 			echo ' class="frm_help"';
2232 2232
 		}
2233 2233
 
2234
-		echo ' title="' . esc_attr( $tooltips[ $name ] );
2234
+		echo ' title="' . esc_attr( $tooltips[$name] );
2235 2235
 
2236 2236
 		if ( 'open' != $class ) {
2237 2237
 			echo '"';
@@ -2286,13 +2286,13 @@  discard block
 block discarded – undo
2286 2286
 	}
2287 2287
 
2288 2288
 	private static function prepare_action_slashes( $val, $key, &$post_content ) {
2289
-		if ( ! isset( $post_content[ $key ] ) || is_numeric( $val ) ) {
2289
+		if ( ! isset( $post_content[$key] ) || is_numeric( $val ) ) {
2290 2290
 			return;
2291 2291
 		}
2292 2292
 
2293 2293
 		if ( is_array( $val ) ) {
2294 2294
 			foreach ( $val as $k1 => $v1 ) {
2295
-				self::prepare_action_slashes( $v1, $k1, $post_content[ $key ] );
2295
+				self::prepare_action_slashes( $v1, $k1, $post_content[$key] );
2296 2296
 				unset( $k1, $v1 );
2297 2297
 			}
2298 2298
 		} else {
@@ -2300,7 +2300,7 @@  discard block
 block discarded – undo
2300 2300
 			$val = stripslashes( $val );
2301 2301
 
2302 2302
 			// Add backslashes before double quotes and forward slashes only
2303
-			$post_content[ $key ] = addcslashes( $val, '"\\/' );
2303
+			$post_content[$key] = addcslashes( $val, '"\\/' );
2304 2304
 		}
2305 2305
 	}
2306 2306
 
@@ -2359,14 +2359,14 @@  discard block
 block discarded – undo
2359 2359
 				continue;
2360 2360
 			}
2361 2361
 			$key = $input['name'];
2362
-			if ( isset( $formatted[ $key ] ) ) {
2363
-				if ( is_array( $formatted[ $key ] ) ) {
2364
-					$formatted[ $key ][] = $input['value'];
2362
+			if ( isset( $formatted[$key] ) ) {
2363
+				if ( is_array( $formatted[$key] ) ) {
2364
+					$formatted[$key][] = $input['value'];
2365 2365
 				} else {
2366
-					$formatted[ $key ] = array( $formatted[ $key ], $input['value'] );
2366
+					$formatted[$key] = array( $formatted[$key], $input['value'] );
2367 2367
 				}
2368 2368
 			} else {
2369
-				$formatted[ $key ] = $input['value'];
2369
+				$formatted[$key] = $input['value'];
2370 2370
 			}
2371 2371
 		}
2372 2372
 
Please login to merge, or discard this patch.