Completed
Pull Request — master (#253)
by Stephanie
02:33
created
classes/helpers/FrmTipsHelper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
 	}
297 297
 
298 298
 	public static function get_banner_tip() {
299
-		$tips       = array(
299
+		$tips = array(
300 300
 			array(
301 301
 				'link' => array(
302 302
 					'medium'  => 'banner',
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
 			),
324 324
 		);
325 325
 		$random     = rand( 0, count( $tips ) - 1 );
326
-		$tip        = $tips[ $random ];
326
+		$tip        = $tips[$random];
327 327
 		$tip['num'] = $random;
328 328
 
329 329
 		return $tip;
@@ -332,6 +332,6 @@  discard block
 block discarded – undo
332 332
 	public static function get_random_tip( $tips ) {
333 333
 		$random = rand( 0, count( $tips ) - 1 );
334 334
 
335
-		return $tips[ $random ];
335
+		return $tips[$random];
336 336
 	}
337 337
 }
Please login to merge, or discard this patch.
classes/helpers/FrmFormsListHelper.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 		$page     = $this->get_pagenum();
19 19
 		$per_page = $this->get_items_per_page( 'formidable_page_formidable_per_page' );
20 20
 
21
-		$mode    = self::get_param(
21
+		$mode = self::get_param(
22 22
 			array(
23 23
 				'param'   => 'mode',
24 24
 				'default' => 'list',
@@ -30,13 +30,13 @@  discard block
 block discarded – undo
30 30
 				'default' => 'name',
31 31
 			)
32 32
 		);
33
-		$order   = self::get_param(
33
+		$order = self::get_param(
34 34
 			array(
35 35
 				'param'   => 'order',
36 36
 				'default' => 'ASC',
37 37
 			)
38 38
 		);
39
-		$start   = self::get_param(
39
+		$start = self::get_param(
40 40
 			array(
41 41
 				'param'   => 'start',
42 42
 				'default' => ( $page - 1 ) * $per_page,
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 
178 178
 			if ( $counts->{$status} || 'draft' !== $status ) {
179 179
 				/* translators: %1$s: Status, %2$s: Number of items */
180
-				$links[ $status ] = '<a href="' . esc_url( '?page=formidable&form_type=' . $status ) . '" ' . $class . '>' . sprintf( __( '%1$s <span class="count">(%2$s)</span>', 'formidable' ), $name, number_format_i18n( $counts->{$status} ) ) . '</a>';
180
+				$links[$status] = '<a href="' . esc_url( '?page=formidable&form_type=' . $status ) . '" ' . $class . '>' . sprintf( __( '%1$s <span class="count">(%2$s)</span>', 'formidable' ), $name, number_format_i18n( $counts->{$status} ) ) . '</a>';
181 181
 			}
182 182
 
183 183
 			unset( $status, $name );
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
 	private function get_actions( &$actions, $item, $edit_link ) {
283 283
 		$new_actions = FrmFormsHelper::get_action_links( $item->id, $item );
284 284
 		foreach ( $new_actions as $link => $action ) {
285
-			$new_actions[ $link ] = FrmFormsHelper::format_link_html( $action, 'short' );
285
+			$new_actions[$link] = FrmFormsHelper::format_link_html( $action, 'short' );
286 286
 		}
287 287
 
288 288
 		if ( 'trash' == $this->status ) {
Please login to merge, or discard this patch.
classes/helpers/FrmShortcodeHelper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -61,8 +61,8 @@  discard block
 block discarded – undo
61 61
 		}
62 62
 
63 63
 		$with_tags = $args['conditional_check'] ? 3 : 2;
64
-		if ( ! empty( $shortcodes[ $with_tags ][ $short_key ] ) ) {
65
-			$tag  = str_replace( '[' . $prefix, '', $shortcodes[0][ $short_key ] );
64
+		if ( ! empty( $shortcodes[$with_tags][$short_key] ) ) {
65
+			$tag  = str_replace( '[' . $prefix, '', $shortcodes[0][$short_key] );
66 66
 			$tag  = str_replace( ']', '', $tag );
67 67
 			$tag  = str_replace( chr( 194 ) . chr( 160 ), ' ', $tag );
68 68
 			$tags = preg_split( '/\s+/', $tag, 2 );
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 				$tag = $tags[0];
71 71
 			}
72 72
 		} else {
73
-			$tag = $shortcodes[ $with_tags - 1 ][ $short_key ];
73
+			$tag = $shortcodes[$with_tags - 1][$short_key];
74 74
 		}
75 75
 
76 76
 		return $tag;
Please login to merge, or discard this patch.
classes/controllers/FrmSettingsController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 				$section['function'] = $original;
116 116
 			}
117 117
 
118
-			$sections[ $key ] = $section;
118
+			$sections[$key] = $section;
119 119
 		}
120 120
 
121 121
 		return $sections;
@@ -127,11 +127,11 @@  discard block
 block discarded – undo
127 127
 
128 128
 		$section  = FrmAppHelper::get_post_param( 'tab', '', 'sanitize_text_field' );
129 129
 		$sections = self::get_settings_tabs();
130
-		if ( ! isset( $sections[ $section ] ) ) {
130
+		if ( ! isset( $sections[$section] ) ) {
131 131
 			wp_die();
132 132
 		}
133 133
 
134
-		$section = $sections[ $section ];
134
+		$section = $sections[$section];
135 135
 
136 136
 		if ( isset( $section['class'] ) ) {
137 137
 			call_user_func( array( $section['class'], $section['function'] ) );
Please login to merge, or discard this patch.
classes/controllers/FrmFormActionsController.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -98,19 +98,19 @@  discard block
 block discarded – undo
98 98
 		}
99 99
 
100 100
 		foreach ( $action_controls as $action ) {
101
-			if ( isset( $groups[ $action->id_base ] ) || in_array( $action->id_base, $grouped ) ) {
101
+			if ( isset( $groups[$action->id_base] ) || in_array( $action->id_base, $grouped ) ) {
102 102
 				continue;
103 103
 			}
104 104
 
105 105
 			$this_group = $action->action_options['group'];
106
-			if ( ! isset( $groups[ $this_group ] ) ) {
106
+			if ( ! isset( $groups[$this_group] ) ) {
107 107
 				$this_group = 'misc';
108 108
 			}
109 109
 
110
-			if ( ! isset( $groups[ $this_group ]['actions'] ) ) {
111
-				$groups[ $this_group ]['actions'] = array();
110
+			if ( ! isset( $groups[$this_group]['actions'] ) ) {
111
+				$groups[$this_group]['actions'] = array();
112 112
 			}
113
-			$groups[ $this_group ]['actions'][] = $action->id_base;
113
+			$groups[$this_group]['actions'][] = $action->id_base;
114 114
 
115 115
 			unset( $action );
116 116
 		}
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 				return $a;
242 242
 			}
243 243
 
244
-			$actions[ $a->id_base ] = $a;
244
+			$actions[$a->id_base] = $a;
245 245
 		}
246 246
 
247 247
 		return $actions;
@@ -272,16 +272,16 @@  discard block
 block discarded – undo
272 272
 		$action_map = array();
273 273
 
274 274
 		foreach ( $action_controls as $key => $control ) {
275
-			$action_map[ $control->id_base ] = $key;
275
+			$action_map[$control->id_base] = $key;
276 276
 		}
277 277
 
278 278
 		foreach ( $form_actions as $action ) {
279
-			if ( ! isset( $action_map[ $action->post_excerpt ] ) ) {
279
+			if ( ! isset( $action_map[$action->post_excerpt] ) ) {
280 280
 				// don't try and show settings if action no longer exists
281 281
 				continue;
282 282
 			}
283 283
 
284
-			self::action_control( $action, $form, $action->ID, $action_controls[ $action_map[ $action->post_excerpt ] ], $values );
284
+			self::action_control( $action, $form, $action->ID, $action_controls[$action_map[$action->post_excerpt]], $values );
285 285
 		}
286 286
 	}
287 287
 
@@ -489,8 +489,8 @@  discard block
 block discarded – undo
489 489
 			}
490 490
 
491 491
 			// Store actions so they can be triggered with the correct priority.
492
-			$stored_actions[ $action->ID ]  = $action;
493
-			$action_priority[ $action->ID ] = $link_settings[ $action->post_excerpt ]->action_options['priority'];
492
+			$stored_actions[$action->ID]  = $action;
493
+			$action_priority[$action->ID] = $link_settings[$action->post_excerpt]->action_options['priority'];
494 494
 
495 495
 			unset( $action );
496 496
 		}
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
 			new FrmNotification();
503 503
 
504 504
 			foreach ( $action_priority as $action_id => $priority ) {
505
-				$action = $stored_actions[ $action_id ];
505
+				$action = $stored_actions[$action_id];
506 506
 				do_action( 'frm_trigger_' . $action->post_excerpt . '_action', $action, $entry, $form, $event );
507 507
 				do_action( 'frm_trigger_' . $action->post_excerpt . '_' . $event . '_action', $action, $entry, $form );
508 508
 
@@ -549,12 +549,12 @@  discard block
 block discarded – undo
549 549
 	}
550 550
 
551 551
 	public function register( $action_class ) {
552
-		$this->actions[ $action_class ] = new $action_class();
552
+		$this->actions[$action_class] = new $action_class();
553 553
 	}
554 554
 
555 555
 	public function unregister( $action_class ) {
556
-		if ( isset( $this->actions[ $action_class ] ) ) {
557
-			unset( $this->actions[ $action_class ] );
556
+		if ( isset( $this->actions[$action_class] ) ) {
557
+			unset( $this->actions[$action_class] );
558 558
 		}
559 559
 	}
560 560
 
@@ -563,8 +563,8 @@  discard block
 block discarded – undo
563 563
 
564 564
 		foreach ( $keys as $key ) {
565 565
 			// don't register new action if old action with the same id is already registered
566
-			if ( ! isset( $this->actions[ $key ] ) ) {
567
-				$this->actions[ $key ]->_register();
566
+			if ( ! isset( $this->actions[$key] ) ) {
567
+				$this->actions[$key]->_register();
568 568
 			}
569 569
 		}
570 570
 	}
Please login to merge, or discard this patch.
classes/views/frm-forms/list-templates.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -30,11 +30,11 @@  discard block
 block discarded – undo
30 30
 			</li>
31 31
 			<?php
32 32
 			foreach ( array( 20872734, 20874748, 20882522, 20874739 ) as $template ) {
33
-				if ( ! isset( $templates[ $template ] ) ) {
33
+				if ( ! isset( $templates[$template] ) ) {
34 34
 					continue;
35 35
 				}
36 36
 
37
-				$template      = $templates[ $template ];
37
+				$template      = $templates[$template];
38 38
 				$plan_required = FrmFormsHelper::get_plan_required( $template );
39 39
 				$link          = FrmFormsHelper::get_template_install_link( $template, compact( 'pricing', 'license_type', 'plan_required' ) );
40 40
 				?>
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 					</div>
139 139
 				</td>
140 140
 				</tr>
141
-				<?php unset( $template, $templates[ $k ] ); ?>
141
+				<?php unset( $template, $templates[$k] ); ?>
142 142
 			<?php } ?>
143 143
 		</tbody>
144 144
 </table>
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
 							</div>
239 239
 						</td>
240 240
 					</tr>
241
-					<?php unset( $template, $templates[ $k ] ); ?>
241
+					<?php unset( $template, $templates[$k] ); ?>
242 242
 				<?php } ?>
243 243
 				</tbody>
244 244
 			</table>
Please login to merge, or discard this patch.
classes/models/FrmMigrate.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
 
330 330
 		foreach ( (array) $fields as $f ) {
331 331
 			FrmAppHelper::unserialize_or_decode( $f->field_options );
332
-			$size             = $f->field_options['size'];
332
+			$size = $f->field_options['size'];
333 333
 			$this->maybe_convert_migrated_size( $size );
334 334
 
335 335
 			if ( $size === $f->field_options['size'] ) {
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
 				continue;
393 393
 			}
394 394
 
395
-			$this->maybe_convert_migrated_size( $widgets[ $k ]['size'] );
395
+			$this->maybe_convert_migrated_size( $widgets[$k]['size'] );
396 396
 		}
397 397
 		update_option( 'widget_frm_show_form', $widgets );
398 398
 	}
@@ -491,7 +491,7 @@  discard block
 block discarded – undo
491 491
 			if ( ! is_array( $widget ) || ! isset( $widget['size'] ) ) {
492 492
 				continue;
493 493
 			}
494
-			$this->convert_character_to_px( $widgets[ $k ]['size'] );
494
+			$this->convert_character_to_px( $widgets[$k]['size'] );
495 495
 		}
496 496
 		update_option( 'widget_frm_show_form', $widgets );
497 497
 	}
Please login to merge, or discard this patch.
classes/helpers/FrmEntriesHelper.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -136,6 +136,9 @@
 block discarded – undo
136 136
 		return apply_filters( 'frm_setup_edit_entry_vars', $values, $record );
137 137
 	}
138 138
 
139
+	/**
140
+	 * @param string $message
141
+	 */
139 142
 	public static function replace_default_message( $message, $atts ) {
140 143
 		if ( strpos( $message, '[default-message' ) === false &&
141 144
 			strpos( $message, '[default_message' ) === false &&
Please login to merge, or discard this patch.
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -117,10 +117,10 @@  discard block
 block discarded – undo
117 117
 		if ( $_POST ) {
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 ] ) ) {
120
+				if ( isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field->id] ) ) {
121 121
 					$value_is_posted = true;
122 122
 				}
123
-			} elseif ( isset( $_POST['item_meta'][ $field->id ] ) ) {
123
+			} elseif ( isset( $_POST['item_meta'][$field->id] ) ) {
124 124
 				$value_is_posted = true;
125 125
 			}
126 126
 		}
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 		preg_match_all( "/\[(default-message|default_message)\b(.*?)(?:(\/))?\]/s", $message, $shortcodes, PREG_PATTERN_ORDER );
151 151
 
152 152
 		foreach ( $shortcodes[0] as $short_key => $tag ) {
153
-			$add_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][ $short_key ] );
153
+			$add_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][$short_key] );
154 154
 			if ( ! empty( $add_atts ) ) {
155 155
 				$this_atts = array_merge( $atts, $add_atts );
156 156
 			} else {
@@ -160,14 +160,14 @@  discard block
 block discarded – undo
160 160
 			$default = FrmEntriesController::show_entry_shortcode( $this_atts );
161 161
 
162 162
 			// Add the default message.
163
-			$message = str_replace( $shortcodes[0][ $short_key ], $default, $message );
163
+			$message = str_replace( $shortcodes[0][$short_key], $default, $message );
164 164
 		}
165 165
 
166 166
 		return $message;
167 167
 	}
168 168
 
169 169
 	public static function prepare_display_value( $entry, $field, $atts ) {
170
-		$field_value = isset( $entry->metas[ $field->id ] ) ? $entry->metas[ $field->id ] : false;
170
+		$field_value = isset( $entry->metas[$field->id] ) ? $entry->metas[$field->id] : false;
171 171
 
172 172
 		if ( FrmAppHelper::pro_is_installed() ) {
173 173
 			$empty = empty( $field_value );
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 			$child_entries = FrmEntry::getAll( array( 'it.parent_item_id' => $entry->id ) );
191 191
 		} else {
192 192
 			// Get all values for this field.
193
-			$child_values = isset( $entry->metas[ $atts['embedded_field_id'] ] ) ? $entry->metas[ $atts['embedded_field_id'] ] : false;
193
+			$child_values = isset( $entry->metas[$atts['embedded_field_id']] ) ? $entry->metas[$atts['embedded_field_id']] : false;
194 194
 
195 195
 			if ( $child_values ) {
196 196
 				$child_entries = FrmEntry::getAll( array( 'it.id' => (array) $child_values ) );
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
 			$value = $args['temp_value'];
309 309
 		}
310 310
 		if ( empty( $args['parent_field_id'] ) ) {
311
-			$_POST['item_meta'][ $field->id ] = $value;
311
+			$_POST['item_meta'][$field->id] = $value;
312 312
 		} else {
313 313
 			self::set_parent_field_posted_value( $field, $value, $args );
314 314
 		}
@@ -320,20 +320,20 @@  discard block
 block discarded – undo
320 320
 	 * @since 4.01
321 321
 	 */
322 322
 	private static function set_parent_field_posted_value( $field, $value, $args ) {
323
-		if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ] ) &&
324
-			 is_array( $_POST['item_meta'][ $args['parent_field_id'] ] ) ) {
323
+		if ( isset( $_POST['item_meta'][$args['parent_field_id']] ) &&
324
+			 is_array( $_POST['item_meta'][$args['parent_field_id']] ) ) {
325 325
 
326
-			if ( ! isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) ||
327
-				 ! is_array( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) ) {
328
-				$_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] = array();
326
+			if ( ! isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] ) ||
327
+				 ! is_array( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] ) ) {
328
+				$_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] = array();
329 329
 			}
330 330
 		} else {
331 331
 			// All of the section was probably removed.
332
-			$_POST['item_meta'][ $args['parent_field_id'] ] = array();
333
-			$_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] = array();
332
+			$_POST['item_meta'][$args['parent_field_id']] = array();
333
+			$_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] = array();
334 334
 		}
335 335
 
336
-		$_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field->id ] = $value;
336
+		$_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field->id] = $value;
337 337
 	}
338 338
 
339 339
 	public static function get_posted_value( $field, &$value, $args ) {
@@ -364,10 +364,10 @@  discard block
 block discarded – undo
364 364
 		if ( empty( $args['parent_field_id'] ) ) {
365 365
 			// Sanitizing is done next.
366 366
 			// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
367
-			$value = isset( $_POST['item_meta'][ $field_id ] ) ? wp_unslash( $_POST['item_meta'][ $field_id ] ) : '';
367
+			$value = isset( $_POST['item_meta'][$field_id] ) ? wp_unslash( $_POST['item_meta'][$field_id] ) : '';
368 368
 		} else {
369 369
 			// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
370
-			$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 ] ) : '';
370
+			$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] ) : '';
371 371
 		}
372 372
 		return $value;
373 373
 	}
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
 		self::set_other_repeating_vals( $field, $value, $args );
399 399
 
400 400
 		// Check if there are any posted "Other" values.
401
-		if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][ $field->id ] ) ) {
401
+		if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][$field->id] ) ) {
402 402
 
403 403
 			// Save original value.
404 404
 			$args['temp_value'] = $value;
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
 
407 407
 			// Sanitizing is done next.
408 408
 			// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
409
-			$other_vals = wp_unslash( $_POST['item_meta']['other'][ $field->id ] );
409
+			$other_vals = wp_unslash( $_POST['item_meta']['other'][$field->id] );
410 410
 			FrmAppHelper::sanitize_value( 'sanitize_text_field', $other_vals );
411 411
 
412 412
 			// Set the validation value now
@@ -429,13 +429,13 @@  discard block
 block discarded – undo
429 429
 		}
430 430
 
431 431
 		// Check if there are any other posted "other" values for this field.
432
-		if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ]['other'][ $field->id ] ) ) {
432
+		if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']]['other'][$field->id] ) ) {
433 433
 			// Save original value
434 434
 			$args['temp_value'] = $value;
435 435
 			$args['other']      = true;
436 436
 
437 437
 			// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
438
-			$other_vals = wp_unslash( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ]['other'][ $field->id ] );
438
+			$other_vals = wp_unslash( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']]['other'][$field->id] );
439 439
 			FrmAppHelper::sanitize_value( 'sanitize_text_field', $other_vals );
440 440
 
441 441
 			// Set the validation value now.
@@ -462,7 +462,7 @@  discard block
 block discarded – undo
462 462
 		if ( is_array( $value ) && $field->type === 'checkbox' ) {
463 463
 			// Combine "Other" values with checked values. "Other" values will override checked box values.
464 464
 			foreach ( $other_vals as $k => $v ) {
465
-				if ( isset( $value[ $k ] ) && trim( $v ) === '' ) {
465
+				if ( isset( $value[$k] ) && trim( $v ) === '' ) {
466 466
 					// If the other box is checked, but doesn't have a value.
467 467
 					$value = '';
468 468
 					break;
@@ -479,25 +479,25 @@  discard block
 block discarded – undo
479 479
 
480 480
 			// Multi-select dropdown.
481 481
 			if ( is_array( $value ) ) {
482
-				$o_key = array_search( $field->options[ $other_key ], $value );
482
+				$o_key = array_search( $field->options[$other_key], $value );
483 483
 
484 484
 				if ( $o_key !== false ) {
485 485
 					// Modify the original value so other key will be preserved.
486
-					$value[ $other_key ] = $value[ $o_key ];
486
+					$value[$other_key] = $value[$o_key];
487 487
 
488 488
 					// By default, the array keys will be numeric for multi-select dropdowns.
489 489
 					// If going backwards and forwards between pages, the array key will match the other key.
490 490
 					if ( $o_key !== $other_key ) {
491
-						unset( $value[ $o_key ] );
491
+						unset( $value[$o_key] );
492 492
 					}
493 493
 
494 494
 					$args['temp_value']  = $value;
495
-					$value[ $other_key ] = reset( $other_vals );
496
-					if ( FrmAppHelper::is_empty_value( $value[ $other_key ] ) ) {
497
-						unset( $value[ $other_key ] );
495
+					$value[$other_key] = reset( $other_vals );
496
+					if ( FrmAppHelper::is_empty_value( $value[$other_key] ) ) {
497
+						unset( $value[$other_key] );
498 498
 					}
499 499
 				}
500
-			} elseif ( $field->options[ $other_key ] == $value ) {
500
+			} elseif ( $field->options[$other_key] == $value ) {
501 501
 				$value = $other_vals;
502 502
 			}
503 503
 		}
Please login to merge, or discard this patch.
classes/models/FrmEmail.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 		$to = $this->prepare_email_setting( $this->settings['email_to'], $user_id_args );
86 86
 		$to = $this->explode_emails( $to );
87 87
 
88
-		$where  = array(
88
+		$where = array(
89 89
 			'it.field_id !' => 0,
90 90
 			'it.item_id'    => $this->entry->id,
91 91
 		);
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 			'entry'     => $this->entry,
96 96
 			'form'      => $this->form,
97 97
 		);
98
-		$to     = apply_filters( 'frm_to_email', $to, $values, $this->form->id, $args );
98
+		$to = apply_filters( 'frm_to_email', $to, $values, $this->form->id, $args );
99 99
 
100 100
 		$this->to = array_unique( (array) $to );
101 101
 
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
 
299 299
 		// Add the user info if it isn't already included
300 300
 		if ( $this->include_user_info && $prev_mail_body === $mail_body ) {
301
-			$data      = $this->entry->description;
301
+			$data = $this->entry->description;
302 302
 			$mail_body .= "\r\n\r\n" . __( 'User Information', 'formidable' ) . "\r\n";
303 303
 			$this->maybe_add_ip( $mail_body );
304 304
 			$mail_body .= __( 'User-Agent (Browser/OS)', 'formidable' ) . ': ' . FrmEntriesHelper::get_browser( $data['browser'] ) . "\r\n";
@@ -563,12 +563,12 @@  discard block
 block discarded – undo
563 563
 					$name = trim( str_replace( $email, '', $val ) );
564 564
 				} else {
565 565
 					// If user enters a name without an email
566
-					unset( $recipients[ $key ] );
566
+					unset( $recipients[$key] );
567 567
 					continue;
568 568
 				}
569 569
 			}
570 570
 
571
-			$recipients[ $key ] = $this->format_from_email( $name, $email );
571
+			$recipients[$key] = $this->format_from_email( $name, $email );
572 572
 		}
573 573
 
574 574
 		return $recipients;
@@ -709,7 +709,7 @@  discard block
 block discarded – undo
709 709
 				);
710 710
 
711 711
 				// Remove phone number from to addresses
712
-				unset( $this->to[ $key ] );
712
+				unset( $this->to[$key] );
713 713
 			}
714 714
 		}
715 715
 	}
Please login to merge, or discard this patch.