Completed
Pull Request — master (#2260)
by
unknown
40s
created
classes/helpers/FrmAppHelper.php 1 patch
Spacing   +86 added lines, -86 removed lines patch added patch discarded remove patch
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
 			'fill'   => '#4d4d4d',
226 226
 			'orange' => '#f05a24',
227 227
 		);
228
-		$atts     = array_merge( $defaults, $atts );
228
+		$atts = array_merge( $defaults, $atts );
229 229
 
230 230
 		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'] ) . '">
231 231
 			<path fill="' . esc_attr( $atts['orange'] ) . '" d="M289.6 384h140v76h-140z"/>
@@ -476,7 +476,7 @@  discard block
 block discarded – undo
476 476
 	 * @return string
477 477
 	 */
478 478
 	public static function get_server_value( $value ) {
479
-		return isset( $_SERVER[ $value ] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[ $value ] ) ) : '';
479
+		return isset( $_SERVER[$value] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[$value] ) ) : '';
480 480
 	}
481 481
 
482 482
 	/**
@@ -510,7 +510,7 @@  discard block
 block discarded – undo
510 510
 		$ip         = '';
511 511
 
512 512
 		foreach ( $ip_options as $key ) {
513
-			if ( ! isset( $_SERVER[ $key ] ) ) {
513
+			if ( ! isset( $_SERVER[$key] ) ) {
514 514
 				continue;
515 515
 			}
516 516
 
@@ -579,10 +579,10 @@  discard block
 block discarded – undo
579 579
 		}
580 580
 
581 581
 		if ( $src === 'get' ) {
582
-			$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
583
-			if ( ! isset( $_POST[ $param ] ) && isset( $_GET[ $param ] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
582
+			$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
583
+			if ( ! isset( $_POST[$param] ) && isset( $_GET[$param] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
584 584
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
585
-				$value = htmlspecialchars_decode( wp_unslash( $_GET[ $param ] ) );
585
+				$value = htmlspecialchars_decode( wp_unslash( $_GET[$param] ) );
586 586
 			}
587 587
 			self::sanitize_value( $sanitize, $value );
588 588
 		} else {
@@ -603,7 +603,7 @@  discard block
 block discarded – undo
603 603
 				}
604 604
 
605 605
 				$p     = trim( $p, ']' );
606
-				$value = isset( $value[ $p ] ) ? $value[ $p ] : $default;
606
+				$value = isset( $value[$p] ) ? $value[$p] : $default;
607 607
 			}
608 608
 		}
609 609
 
@@ -668,26 +668,26 @@  discard block
 block discarded – undo
668 668
 			'sanitize'   => 'sanitize_text_field',
669 669
 			'serialized' => false,
670 670
 		);
671
-		$args     = wp_parse_args( $args, $defaults );
671
+		$args = wp_parse_args( $args, $defaults );
672 672
 
673 673
 		$value = $args['default'];
674 674
 		if ( $args['type'] === 'get' ) {
675
-			if ( $_GET && isset( $_GET[ $args['param'] ] ) ) {
675
+			if ( $_GET && isset( $_GET[$args['param']] ) ) {
676 676
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
677
-				$value = wp_unslash( $_GET[ $args['param'] ] );
677
+				$value = wp_unslash( $_GET[$args['param']] );
678 678
 			}
679 679
 		} elseif ( $args['type'] === 'post' ) {
680
-			if ( isset( $_POST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
680
+			if ( isset( $_POST[$args['param']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
681 681
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
682
-				$value = wp_unslash( $_POST[ $args['param'] ] );
682
+				$value = wp_unslash( $_POST[$args['param']] );
683 683
 				if ( $args['serialized'] === true && is_serialized_string( $value ) && is_serialized( $value ) ) {
684 684
 					self::unserialize_or_decode( $value );
685 685
 				}
686 686
 			}
687
-		} elseif ( isset( $_REQUEST[ $args['param'] ] ) ) {
687
+		} elseif ( isset( $_REQUEST[$args['param']] ) ) {
688 688
 			// phpcs:ignore WordPress.Security.NonceVerification.Missing
689 689
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
690
-				$value = wp_unslash( $_REQUEST[ $args['param'] ] );
690
+				$value = wp_unslash( $_REQUEST[$args['param']] );
691 691
 		}
692 692
 
693 693
 		self::sanitize_value( $args['sanitize'], $value );
@@ -734,7 +734,7 @@  discard block
 block discarded – undo
734 734
 		if ( is_array( $value ) ) {
735 735
 			$temp_values = $value;
736 736
 			foreach ( $temp_values as $k => $v ) {
737
-				self::sanitize_value( $sanitize, $value[ $k ] );
737
+				self::sanitize_value( $sanitize, $value[$k] );
738 738
 			}
739 739
 			return;
740 740
 		}
@@ -745,8 +745,8 @@  discard block
 block discarded – undo
745 745
 	public static function sanitize_request( $sanitize_method, &$values ) {
746 746
 		$temp_values = $values;
747 747
 		foreach ( $temp_values as $k => $val ) {
748
-			if ( isset( $sanitize_method[ $k ] ) ) {
749
-				$values[ $k ] = call_user_func( $sanitize_method[ $k ], $val );
748
+			if ( isset( $sanitize_method[$k] ) ) {
749
+				$values[$k] = call_user_func( $sanitize_method[$k], $val );
750 750
 			}
751 751
 		}
752 752
 	}
@@ -806,7 +806,7 @@  discard block
 block discarded – undo
806 806
 		if ( is_array( $value ) ) {
807 807
 			$temp_values = $value;
808 808
 			foreach ( $temp_values as $k => $v ) {
809
-				self::decode_specialchars( $value[ $k ] );
809
+				self::decode_specialchars( $value[$k] );
810 810
 			}
811 811
 		} else {
812 812
 			self::decode_amp( $value );
@@ -941,7 +941,7 @@  discard block
 block discarded – undo
941 941
 	 * @return array
942 942
 	 */
943 943
 	public static function add_allowed_submit_button_tags( $allowed_html ) {
944
-		$allowed_html['input']                    = array(
944
+		$allowed_html['input'] = array(
945 945
 			'type'           => true,
946 946
 			'value'          => true,
947 947
 			'formnovalidate' => true,
@@ -964,7 +964,7 @@  discard block
 block discarded – undo
964 964
 			$allowed_html = $html;
965 965
 		} elseif ( ! empty( $allowed ) ) {
966 966
 			foreach ( (array) $allowed as $a ) {
967
-				$allowed_html[ $a ] = isset( $html[ $a ] ) ? $html[ $a ] : array();
967
+				$allowed_html[$a] = isset( $html[$a] ) ? $html[$a] : array();
968 968
 			}
969 969
 		}
970 970
 
@@ -1148,8 +1148,8 @@  discard block
 block discarded – undo
1148 1148
 		}
1149 1149
 
1150 1150
 		global $wp_query;
1151
-		if ( isset( $wp_query->query_vars[ $param ] ) ) {
1152
-			$value = $wp_query->query_vars[ $param ];
1151
+		if ( isset( $wp_query->query_vars[$param] ) ) {
1152
+			$value = $wp_query->query_vars[$param];
1153 1153
 		}
1154 1154
 
1155 1155
 		return $value;
@@ -1180,9 +1180,9 @@  discard block
 block discarded – undo
1180 1180
 			'frm_keyalt_icon'       => 'frm_key_icon',
1181 1181
 			'frm_keyalt_solid_icon' => 'frm_key_solid_icon',
1182 1182
 		);
1183
-		if ( isset( $deprecated[ $icon ] ) ) {
1184
-			$icon  = $deprecated[ $icon ];
1185
-			$class = str_replace( $icon, $deprecated[ $icon ], $class );
1183
+		if ( isset( $deprecated[$icon] ) ) {
1184
+			$icon  = $deprecated[$icon];
1185
+			$class = str_replace( $icon, $deprecated[$icon], $class );
1186 1186
 		}
1187 1187
 
1188 1188
 		if ( $icon === $class ) {
@@ -1304,7 +1304,7 @@  discard block
 block discarded – undo
1304 1304
 	 * @return string|void
1305 1305
 	 */
1306 1306
 	public static function array_to_html_params( $atts, $echo = false ) {
1307
-		$callback = function () use ( $atts ) {
1307
+		$callback = function() use ( $atts ) {
1308 1308
 			if ( $atts ) {
1309 1309
 				foreach ( $atts as $key => $value ) {
1310 1310
 					echo ' ' . esc_attr( $key ) . '="' . esc_attr( $value ) . '"';
@@ -1479,7 +1479,7 @@  discard block
 block discarded – undo
1479 1479
 			'input_id'    => '',
1480 1480
 			'value'       => false,
1481 1481
 		);
1482
-		$atts     = array_merge( $defaults, $atts );
1482
+		$atts = array_merge( $defaults, $atts );
1483 1483
 
1484 1484
 		if ( $atts['input_id'] === 'template' && empty( $atts['tosearch'] ) ) {
1485 1485
 			$atts['tosearch'] = 'frm-card';
@@ -1555,7 +1555,7 @@  discard block
 block discarded – undo
1555 1555
 				'new_file_path' => self::plugin_path() . '/js',
1556 1556
 			)
1557 1557
 		);
1558
-		$new_file  = new FrmCreateFile( $file_atts );
1558
+		$new_file = new FrmCreateFile( $file_atts );
1559 1559
 
1560 1560
 		$files = array(
1561 1561
 			self::plugin_path() . '/js/formidable.min.js',
@@ -2059,8 +2059,8 @@  discard block
 block discarded – undo
2059 2059
 			return $error;
2060 2060
 		}
2061 2061
 
2062
-		$nonce_value = $_REQUEST && isset( $_REQUEST[ $nonce_name ] ) ? sanitize_text_field( wp_unslash( $_REQUEST[ $nonce_name ] ) ) : '';
2063
-		if ( $_REQUEST && ( ! isset( $_REQUEST[ $nonce_name ] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) {
2062
+		$nonce_value = $_REQUEST && isset( $_REQUEST[$nonce_name] ) ? sanitize_text_field( wp_unslash( $_REQUEST[$nonce_name] ) ) : '';
2063
+		if ( $_REQUEST && ( ! isset( $_REQUEST[$nonce_name] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) {
2064 2064
 			$frm_settings = self::get_settings();
2065 2065
 			$error        = $frm_settings->admin_permission;
2066 2066
 		}
@@ -2096,7 +2096,7 @@  discard block
 block discarded – undo
2096 2096
 			} else {
2097 2097
 				foreach ( $value as $k => $v ) {
2098 2098
 					if ( ! is_array( $v ) ) {
2099
-						$value[ $k ] = call_user_func( $original_function, $v );
2099
+						$value[$k] = call_user_func( $original_function, $v );
2100 2100
 					}
2101 2101
 				}
2102 2102
 			}
@@ -2137,7 +2137,7 @@  discard block
 block discarded – undo
2137 2137
 			if ( is_array( $value ) ) {
2138 2138
 				$return = array_merge( $return, self::array_flatten( $value, $keys ) );
2139 2139
 			} elseif ( $keys === 'keep' ) {
2140
-					$return[ $key ] = $value;
2140
+					$return[$key] = $value;
2141 2141
 			} else {
2142 2142
 				$return[] = $value;
2143 2143
 			}
@@ -2212,11 +2212,11 @@  discard block
 block discarded – undo
2212 2212
 		}
2213 2213
 
2214 2214
 		$ver = $default;
2215
-		if ( ! isset( $wp_scripts->registered[ $handle ] ) ) {
2215
+		if ( ! isset( $wp_scripts->registered[$handle] ) ) {
2216 2216
 			return $ver;
2217 2217
 		}
2218 2218
 
2219
-		$query = $wp_scripts->registered[ $handle ];
2219
+		$query = $wp_scripts->registered[$handle];
2220 2220
 		if ( is_object( $query ) && ! empty( $query->ver ) ) {
2221 2221
 			$ver = $query->ver;
2222 2222
 		}
@@ -2232,7 +2232,7 @@  discard block
 block discarded – undo
2232 2232
 	 * @return string|null
2233 2233
 	 */
2234 2234
 	public static function js_redirect( $url, $echo = false ) {
2235
-		$callback = function () use ( $url ) {
2235
+		$callback = function() use ( $url ) {
2236 2236
 			echo '<script type="text/javascript">window.location="' . esc_url_raw( $url ) . '"</script>';
2237 2237
 		};
2238 2238
 		return self::clip( $callback, $echo );
@@ -2327,7 +2327,7 @@  discard block
 block discarded – undo
2327 2327
 			$suffix = 2;
2328 2328
 			do {
2329 2329
 				$key_check = $key . $separator . $suffix;
2330
-				++$suffix;
2330
+				++ $suffix;
2331 2331
 			} while ( in_array( $key_check, $similar_keys, true ) );
2332 2332
 
2333 2333
 			$key = $key_check;
@@ -2435,7 +2435,7 @@  discard block
 block discarded – undo
2435 2435
 
2436 2436
 		foreach ( array( 'name', 'description' ) as $var ) {
2437 2437
 			$default_val    = isset( $record->{$var} ) ? $record->{$var} : '';
2438
-			$values[ $var ] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' );
2438
+			$values[$var] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' );
2439 2439
 			unset( $var, $default_val );
2440 2440
 		}
2441 2441
 
@@ -2491,9 +2491,9 @@  discard block
 block discarded – undo
2491 2491
 			$meta_value = FrmEntryMeta::get_meta_value( $record, $field->id );
2492 2492
 		}//end if
2493 2493
 
2494
-		$field_type = isset( $post_values['field_options'][ 'type_' . $field->id ] ) ? $post_values['field_options'][ 'type_' . $field->id ] : $field->type;
2495
-		if ( isset( $post_values['item_meta'][ $field->id ] ) ) {
2496
-			$new_value = $post_values['item_meta'][ $field->id ];
2494
+		$field_type = isset( $post_values['field_options']['type_' . $field->id] ) ? $post_values['field_options']['type_' . $field->id] : $field->type;
2495
+		if ( isset( $post_values['item_meta'][$field->id] ) ) {
2496
+			$new_value = $post_values['item_meta'][$field->id];
2497 2497
 			self::unserialize_or_decode( $new_value );
2498 2498
 		} else {
2499 2499
 			$new_value = $meta_value;
@@ -2514,7 +2514,7 @@  discard block
 block discarded – undo
2514 2514
 
2515 2515
 		$field_array = array_merge( (array) $field->field_options, $field_array );
2516 2516
 
2517
-		$values['fields'][ $field->id ] = $field_array;
2517
+		$values['fields'][$field->id] = $field_array;
2518 2518
 	}
2519 2519
 
2520 2520
 	/**
@@ -2564,11 +2564,11 @@  discard block
 block discarded – undo
2564 2564
 		}
2565 2565
 
2566 2566
 		foreach ( $form->options as $opt => $value ) {
2567
-			if ( isset( $post_values[ $opt ] ) ) {
2568
-				$values[ $opt ] = $post_values[ $opt ];
2569
-				self::unserialize_or_decode( $values[ $opt ] );
2567
+			if ( isset( $post_values[$opt] ) ) {
2568
+				$values[$opt] = $post_values[$opt];
2569
+				self::unserialize_or_decode( $values[$opt] );
2570 2570
 			} else {
2571
-				$values[ $opt ] = $value;
2571
+				$values[$opt] = $value;
2572 2572
 			}
2573 2573
 		}
2574 2574
 
@@ -2582,8 +2582,8 @@  discard block
 block discarded – undo
2582 2582
 		$form_defaults = FrmFormsHelper::get_default_opts();
2583 2583
 
2584 2584
 		foreach ( $form_defaults as $opt => $default ) {
2585
-			if ( ! isset( $values[ $opt ] ) || $values[ $opt ] == '' ) {
2586
-				$values[ $opt ] = $post_values && isset( $post_values['options'][ $opt ] ) ? $post_values['options'][ $opt ] : $default;
2585
+			if ( ! isset( $values[$opt] ) || $values[$opt] == '' ) {
2586
+				$values[$opt] = $post_values && isset( $post_values['options'][$opt] ) ? $post_values['options'][$opt] : $default;
2587 2587
 			}
2588 2588
 
2589 2589
 			unset( $opt, $default );
@@ -2594,8 +2594,8 @@  discard block
 block discarded – undo
2594 2594
 		}
2595 2595
 
2596 2596
 		foreach ( array( 'before', 'after', 'submit' ) as $h ) {
2597
-			if ( ! isset( $values[ $h . '_html' ] ) ) {
2598
-				$values[ $h . '_html' ] = ( isset( $post_values['options'][ $h . '_html' ] ) ? $post_values['options'][ $h . '_html' ] : FrmFormsHelper::get_default_html( $h ) );
2597
+			if ( ! isset( $values[$h . '_html'] ) ) {
2598
+				$values[$h . '_html'] = ( isset( $post_values['options'][$h . '_html'] ) ? $post_values['options'][$h . '_html'] : FrmFormsHelper::get_default_html( $h ) );
2599 2599
 			}
2600 2600
 			unset( $h );
2601 2601
 		}
@@ -2790,25 +2790,25 @@  discard block
 block discarded – undo
2790 2790
 		if ( ! is_numeric( $levels ) ) {
2791 2791
 			// Show time in specified unit.
2792 2792
 			$levels = self::get_unit( $levels );
2793
-			if ( isset( $time_strings[ $levels ] ) ) {
2793
+			if ( isset( $time_strings[$levels] ) ) {
2794 2794
 				$diff         = array(
2795 2795
 					$levels => self::time_format( $levels, $diff ),
2796 2796
 				);
2797 2797
 				$time_strings = array(
2798
-					$levels => $time_strings[ $levels ],
2798
+					$levels => $time_strings[$levels],
2799 2799
 				);
2800 2800
 			}
2801 2801
 			$levels = 1;
2802 2802
 		}
2803 2803
 
2804 2804
 		foreach ( $time_strings as $k => $v ) {
2805
-			if ( isset( $diff[ $k ] ) && $diff[ $k ] ) {
2806
-				$time_strings[ $k ] = $diff[ $k ] . ' ' . ( $diff[ $k ] > 1 ? $v[1] : $v[0] );
2807
-			} elseif ( isset( $diff[ $k ] ) && count( $time_strings ) === 1 ) {
2805
+			if ( isset( $diff[$k] ) && $diff[$k] ) {
2806
+				$time_strings[$k] = $diff[$k] . ' ' . ( $diff[$k] > 1 ? $v[1] : $v[0] );
2807
+			} elseif ( isset( $diff[$k] ) && count( $time_strings ) === 1 ) {
2808 2808
 				// Account for 0.
2809
-				$time_strings[ $k ] = $diff[ $k ] . ' ' . $v[1];
2809
+				$time_strings[$k] = $diff[$k] . ' ' . $v[1];
2810 2810
 			} else {
2811
-				unset( $time_strings[ $k ] );
2811
+				unset( $time_strings[$k] );
2812 2812
 			}
2813 2813
 		}
2814 2814
 
@@ -2827,8 +2827,8 @@  discard block
 block discarded – undo
2827 2827
 			'y' => 'y',
2828 2828
 			'd' => 'days',
2829 2829
 		);
2830
-		if ( isset( $return[ $unit ] ) ) {
2831
-			return $diff[ $return[ $unit ] ];
2830
+		if ( isset( $return[$unit] ) ) {
2831
+			return $diff[$return[$unit]];
2832 2832
 		}
2833 2833
 
2834 2834
 		$total = $diff['days'] * self::convert_time( 'd', $unit );
@@ -2836,11 +2836,11 @@  discard block
 block discarded – undo
2836 2836
 		$times = array( 'h', 'i', 's' );
2837 2837
 
2838 2838
 		foreach ( $times as $time ) {
2839
-			if ( ! isset( $diff[ $time ] ) ) {
2839
+			if ( ! isset( $diff[$time] ) ) {
2840 2840
 				continue;
2841 2841
 			}
2842 2842
 
2843
-			$total += $diff[ $time ] * self::convert_time( $time, $unit );
2843
+			$total += $diff[$time] * self::convert_time( $time, $unit );
2844 2844
 		}
2845 2845
 
2846 2846
 		return floor( $total );
@@ -2860,7 +2860,7 @@  discard block
 block discarded – undo
2860 2860
 			'y' => DAY_IN_SECONDS * 365.25,
2861 2861
 		);
2862 2862
 
2863
-		return $convert[ $from ] / $convert[ $to ];
2863
+		return $convert[$from] / $convert[$to];
2864 2864
 	}
2865 2865
 
2866 2866
 	/**
@@ -2868,7 +2868,7 @@  discard block
 block discarded – undo
2868 2868
 	 */
2869 2869
 	private static function get_unit( $unit ) {
2870 2870
 		$units = self::get_time_strings();
2871
-		if ( isset( $units[ $unit ] ) || is_numeric( $unit ) ) {
2871
+		if ( isset( $units[$unit] ) || is_numeric( $unit ) ) {
2872 2872
 			return $unit;
2873 2873
 		}
2874 2874
 
@@ -2984,17 +2984,17 @@  discard block
 block discarded – undo
2984 2984
 
2985 2985
 					case 1:
2986 2986
 						$l2 = $name;
2987
-						self::add_value_to_array( $name, $l2, $this_val, $vars[ $l1 ] );
2987
+						self::add_value_to_array( $name, $l2, $this_val, $vars[$l1] );
2988 2988
 						break;
2989 2989
 
2990 2990
 					case 2:
2991 2991
 						$l3 = $name;
2992
-						self::add_value_to_array( $name, $l3, $this_val, $vars[ $l1 ][ $l2 ] );
2992
+						self::add_value_to_array( $name, $l3, $this_val, $vars[$l1][$l2] );
2993 2993
 						break;
2994 2994
 
2995 2995
 					case 3:
2996 2996
 						$l4 = $name;
2997
-						self::add_value_to_array( $name, $l4, $this_val, $vars[ $l1 ][ $l2 ][ $l3 ] );
2997
+						self::add_value_to_array( $name, $l4, $this_val, $vars[$l1][$l2][$l3] );
2998 2998
 				}
2999 2999
 
3000 3000
 				unset( $this_val, $n );
@@ -3013,8 +3013,8 @@  discard block
 block discarded – undo
3013 3013
 	public static function add_value_to_array( $name, $l1, $val, &$vars ) {
3014 3014
 		if ( $name == '' ) {
3015 3015
 			$vars[] = $val;
3016
-		} elseif ( ! isset( $vars[ $l1 ] ) ) {
3017
-			$vars[ $l1 ] = $val;
3016
+		} elseif ( ! isset( $vars[$l1] ) ) {
3017
+			$vars[$l1] = $val;
3018 3018
 		}
3019 3019
 	}
3020 3020
 
@@ -3031,7 +3031,7 @@  discard block
 block discarded – undo
3031 3031
 			'new_tab'       => __( 'This option will open the link in a new browser tab. Please note that some popup blockers may prevent this from happening, in which case the link will be displayed.', 'formidable' ),
3032 3032
 		);
3033 3033
 
3034
-		if ( ! isset( $tooltips[ $name ] ) ) {
3034
+		if ( ! isset( $tooltips[$name] ) ) {
3035 3035
 			return;
3036 3036
 		}
3037 3037
 
@@ -3041,7 +3041,7 @@  discard block
 block discarded – undo
3041 3041
 			echo ' class="frm_help"';
3042 3042
 		}
3043 3043
 
3044
-		echo ' title="' . esc_attr( $tooltips[ $name ] );
3044
+		echo ' title="' . esc_attr( $tooltips[$name] );
3045 3045
 
3046 3046
 		if ( 'open' != $class ) {
3047 3047
 			echo '"';
@@ -3100,13 +3100,13 @@  discard block
 block discarded – undo
3100 3100
 	}
3101 3101
 
3102 3102
 	private static function prepare_action_slashes( $val, $key, &$post_content ) {
3103
-		if ( ! isset( $post_content[ $key ] ) || is_numeric( $val ) ) {
3103
+		if ( ! isset( $post_content[$key] ) || is_numeric( $val ) ) {
3104 3104
 			return;
3105 3105
 		}
3106 3106
 
3107 3107
 		if ( is_array( $val ) ) {
3108 3108
 			foreach ( $val as $k1 => $v1 ) {
3109
-				self::prepare_action_slashes( $v1, $k1, $post_content[ $key ] );
3109
+				self::prepare_action_slashes( $v1, $k1, $post_content[$key] );
3110 3110
 				unset( $k1, $v1 );
3111 3111
 			}
3112 3112
 		} else {
@@ -3114,7 +3114,7 @@  discard block
 block discarded – undo
3114 3114
 			$val = stripslashes( $val );
3115 3115
 
3116 3116
 			// Add backslashes before double quotes and forward slashes only
3117
-			$post_content[ $key ] = addcslashes( $val, '"\\/' );
3117
+			$post_content[$key] = addcslashes( $val, '"\\/' );
3118 3118
 		}
3119 3119
 	}
3120 3120
 
@@ -3235,14 +3235,14 @@  discard block
 block discarded – undo
3235 3235
 				continue;
3236 3236
 			}
3237 3237
 			$key = $input['name'];
3238
-			if ( isset( $formatted[ $key ] ) ) {
3239
-				if ( is_array( $formatted[ $key ] ) ) {
3240
-					$formatted[ $key ][] = $input['value'];
3238
+			if ( isset( $formatted[$key] ) ) {
3239
+				if ( is_array( $formatted[$key] ) ) {
3240
+					$formatted[$key][] = $input['value'];
3241 3241
 				} else {
3242
-					$formatted[ $key ] = array( $formatted[ $key ], $input['value'] );
3242
+					$formatted[$key] = array( $formatted[$key], $input['value'] );
3243 3243
 				}
3244 3244
 			} else {
3245
-				$formatted[ $key ] = $input['value'];
3245
+				$formatted[$key] = $input['value'];
3246 3246
 			}
3247 3247
 		}
3248 3248
 
@@ -3329,7 +3329,7 @@  discard block
 block discarded – undo
3329 3329
 	 * @return void
3330 3330
 	 */
3331 3331
 	public static function localize_script( $location ) {
3332
-		if ( ! empty( self::$localized_script_locations[ $location ] ) ) {
3332
+		if ( ! empty( self::$localized_script_locations[$location] ) ) {
3333 3333
 			return;
3334 3334
 		}
3335 3335
 
@@ -3437,7 +3437,7 @@  discard block
 block discarded – undo
3437 3437
 			}
3438 3438
 		}//end if
3439 3439
 
3440
-		self::$localized_script_locations[ $location ] = true;
3440
+		self::$localized_script_locations[$location] = true;
3441 3441
 	}
3442 3442
 
3443 3443
 	/**
@@ -3956,8 +3956,8 @@  discard block
 block discarded – undo
3956 3956
 		}
3957 3957
 
3958 3958
 		foreach ( $keys as $key ) {
3959
-			if ( isset( $values[ $key ] ) ) {
3960
-				$values[ $key ] = self::kses( $values[ $key ], 'all' );
3959
+			if ( isset( $values[$key] ) ) {
3960
+				$values[$key] = self::kses( $values[$key], 'all' );
3961 3961
 			}
3962 3962
 		}
3963 3963
 
@@ -4022,7 +4022,7 @@  discard block
 block discarded – undo
4022 4022
 				'role',
4023 4023
 				'style',
4024 4024
 			);
4025
-			$safe      = in_array( $key, $safe_keys, true );
4025
+			$safe = in_array( $key, $safe_keys, true );
4026 4026
 		}//end if
4027 4027
 
4028 4028
 		/**
@@ -4161,7 +4161,7 @@  discard block
 block discarded – undo
4161 4161
 			return 0;
4162 4162
 		}
4163 4163
 
4164
-		return strlen( $parts[ count( $parts ) - 1 ] );
4164
+		return strlen( $parts[count( $parts ) - 1] );
4165 4165
 	}
4166 4166
 
4167 4167
 	/**
@@ -4181,7 +4181,7 @@  discard block
 block discarded – undo
4181 4181
 
4182 4182
 		add_filter(
4183 4183
 			'option_gmt_offset',
4184
-			function ( $offset ) {
4184
+			function( $offset ) {
4185 4185
 				if ( ! is_string( $offset ) || is_numeric( $offset ) ) {
4186 4186
 					// Leave a valid value alone.
4187 4187
 					return $offset;
@@ -4278,7 +4278,7 @@  discard block
 block discarded – undo
4278 4278
 			return;
4279 4279
 		}
4280 4280
 
4281
-		$ajax_callback = function () use ( $option ) {
4281
+		$ajax_callback = function() use ( $option ) {
4282 4282
 			self::dismiss_warning_message( $option );
4283 4283
 		};
4284 4284
 
@@ -4288,7 +4288,7 @@  discard block
 block discarded – undo
4288 4288
 
4289 4289
 		add_filter(
4290 4290
 			'frm_message_list',
4291
-			function ( $show_messages ) use ( $message, $option ) {
4291
+			function( $show_messages ) use ( $message, $option ) {
4292 4292
 				if ( get_option( $option, false ) ) {
4293 4293
 					return $show_messages;
4294 4294
 				}
Please login to merge, or discard this patch.