Completed
Pull Request — master (#2187)
by
unknown
35s
created
classes/helpers/FrmAppHelper.php 1 patch
Spacing   +88 added lines, -88 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"/>
@@ -499,7 +499,7 @@  discard block
 block discarded – undo
499 499
 	 * @return string
500 500
 	 */
501 501
 	public static function get_server_value( $value ) {
502
-		return isset( $_SERVER[ $value ] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[ $value ] ) ) : '';
502
+		return isset( $_SERVER[$value] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[$value] ) ) : '';
503 503
 	}
504 504
 
505 505
 	/**
@@ -533,7 +533,7 @@  discard block
 block discarded – undo
533 533
 		$ip         = '';
534 534
 
535 535
 		foreach ( $ip_options as $key ) {
536
-			if ( ! isset( $_SERVER[ $key ] ) ) {
536
+			if ( ! isset( $_SERVER[$key] ) ) {
537 537
 				continue;
538 538
 			}
539 539
 
@@ -602,10 +602,10 @@  discard block
 block discarded – undo
602 602
 		}
603 603
 
604 604
 		if ( $src === 'get' ) {
605
-			$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
606
-			if ( ! isset( $_POST[ $param ] ) && isset( $_GET[ $param ] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
605
+			$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
606
+			if ( ! isset( $_POST[$param] ) && isset( $_GET[$param] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
607 607
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
608
-				$value = htmlspecialchars_decode( wp_unslash( $_GET[ $param ] ) );
608
+				$value = htmlspecialchars_decode( wp_unslash( $_GET[$param] ) );
609 609
 			}
610 610
 			self::sanitize_value( $sanitize, $value );
611 611
 		} else {
@@ -626,7 +626,7 @@  discard block
 block discarded – undo
626 626
 				}
627 627
 
628 628
 				$p     = trim( $p, ']' );
629
-				$value = isset( $value[ $p ] ) ? $value[ $p ] : $default;
629
+				$value = isset( $value[$p] ) ? $value[$p] : $default;
630 630
 			}
631 631
 		}
632 632
 
@@ -691,26 +691,26 @@  discard block
 block discarded – undo
691 691
 			'sanitize'   => 'sanitize_text_field',
692 692
 			'serialized' => false,
693 693
 		);
694
-		$args     = wp_parse_args( $args, $defaults );
694
+		$args = wp_parse_args( $args, $defaults );
695 695
 
696 696
 		$value = $args['default'];
697 697
 		if ( $args['type'] === 'get' ) {
698
-			if ( $_GET && isset( $_GET[ $args['param'] ] ) ) {
698
+			if ( $_GET && isset( $_GET[$args['param']] ) ) {
699 699
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
700
-				$value = wp_unslash( $_GET[ $args['param'] ] );
700
+				$value = wp_unslash( $_GET[$args['param']] );
701 701
 			}
702 702
 		} elseif ( $args['type'] === 'post' ) {
703
-			if ( isset( $_POST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
703
+			if ( isset( $_POST[$args['param']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
704 704
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
705
-				$value = wp_unslash( $_POST[ $args['param'] ] );
705
+				$value = wp_unslash( $_POST[$args['param']] );
706 706
 				if ( $args['serialized'] === true && is_serialized_string( $value ) && is_serialized( $value ) ) {
707 707
 					self::unserialize_or_decode( $value );
708 708
 				}
709 709
 			}
710
-		} elseif ( isset( $_REQUEST[ $args['param'] ] ) ) {
710
+		} elseif ( isset( $_REQUEST[$args['param']] ) ) {
711 711
 			// phpcs:ignore WordPress.Security.NonceVerification.Missing
712 712
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
713
-				$value = wp_unslash( $_REQUEST[ $args['param'] ] );
713
+				$value = wp_unslash( $_REQUEST[$args['param']] );
714 714
 		}
715 715
 
716 716
 		self::sanitize_value( $args['sanitize'], $value );
@@ -757,7 +757,7 @@  discard block
 block discarded – undo
757 757
 		if ( is_array( $value ) ) {
758 758
 			$temp_values = $value;
759 759
 			foreach ( $temp_values as $k => $v ) {
760
-				self::sanitize_value( $sanitize, $value[ $k ] );
760
+				self::sanitize_value( $sanitize, $value[$k] );
761 761
 			}
762 762
 			return;
763 763
 		}
@@ -768,8 +768,8 @@  discard block
 block discarded – undo
768 768
 	public static function sanitize_request( $sanitize_method, &$values ) {
769 769
 		$temp_values = $values;
770 770
 		foreach ( $temp_values as $k => $val ) {
771
-			if ( isset( $sanitize_method[ $k ] ) ) {
772
-				$values[ $k ] = call_user_func( $sanitize_method[ $k ], $val );
771
+			if ( isset( $sanitize_method[$k] ) ) {
772
+				$values[$k] = call_user_func( $sanitize_method[$k], $val );
773 773
 			}
774 774
 		}
775 775
 	}
@@ -829,7 +829,7 @@  discard block
 block discarded – undo
829 829
 		if ( is_array( $value ) ) {
830 830
 			$temp_values = $value;
831 831
 			foreach ( $temp_values as $k => $v ) {
832
-				self::decode_specialchars( $value[ $k ] );
832
+				self::decode_specialchars( $value[$k] );
833 833
 			}
834 834
 		} else {
835 835
 			self::decode_amp( $value );
@@ -964,7 +964,7 @@  discard block
 block discarded – undo
964 964
 	 * @return array
965 965
 	 */
966 966
 	public static function add_allowed_submit_button_tags( $allowed_html ) {
967
-		$allowed_html['input']                    = array(
967
+		$allowed_html['input'] = array(
968 968
 			'type'           => true,
969 969
 			'value'          => true,
970 970
 			'formnovalidate' => true,
@@ -987,7 +987,7 @@  discard block
 block discarded – undo
987 987
 			$allowed_html = $html;
988 988
 		} elseif ( ! empty( $allowed ) ) {
989 989
 			foreach ( (array) $allowed as $a ) {
990
-				$allowed_html[ $a ] = isset( $html[ $a ] ) ? $html[ $a ] : array();
990
+				$allowed_html[$a] = isset( $html[$a] ) ? $html[$a] : array();
991 991
 			}
992 992
 		}
993 993
 
@@ -1171,8 +1171,8 @@  discard block
 block discarded – undo
1171 1171
 		}
1172 1172
 
1173 1173
 		global $wp_query;
1174
-		if ( isset( $wp_query->query_vars[ $param ] ) ) {
1175
-			$value = $wp_query->query_vars[ $param ];
1174
+		if ( isset( $wp_query->query_vars[$param] ) ) {
1175
+			$value = $wp_query->query_vars[$param];
1176 1176
 		}
1177 1177
 
1178 1178
 		return $value;
@@ -1203,9 +1203,9 @@  discard block
 block discarded – undo
1203 1203
 			'frm_keyalt_icon'       => 'frm_key_icon',
1204 1204
 			'frm_keyalt_solid_icon' => 'frm_key_solid_icon',
1205 1205
 		);
1206
-		if ( isset( $deprecated[ $icon ] ) ) {
1207
-			$icon  = $deprecated[ $icon ];
1208
-			$class = str_replace( $icon, $deprecated[ $icon ], $class );
1206
+		if ( isset( $deprecated[$icon] ) ) {
1207
+			$icon  = $deprecated[$icon];
1208
+			$class = str_replace( $icon, $deprecated[$icon], $class );
1209 1209
 		}
1210 1210
 
1211 1211
 		if ( $icon === $class ) {
@@ -1327,7 +1327,7 @@  discard block
 block discarded – undo
1327 1327
 	 * @return string|void
1328 1328
 	 */
1329 1329
 	public static function array_to_html_params( $atts, $echo = false ) {
1330
-		$callback = function () use ( $atts ) {
1330
+		$callback = function() use ( $atts ) {
1331 1331
 			if ( $atts ) {
1332 1332
 				foreach ( $atts as $key => $value ) {
1333 1333
 					echo ' ' . esc_attr( $key ) . '="' . esc_attr( $value ) . '"';
@@ -1502,7 +1502,7 @@  discard block
 block discarded – undo
1502 1502
 			'input_id'    => '',
1503 1503
 			'value'       => false,
1504 1504
 		);
1505
-		$atts     = array_merge( $defaults, $atts );
1505
+		$atts = array_merge( $defaults, $atts );
1506 1506
 
1507 1507
 		if ( $atts['input_id'] === 'template' && empty( $atts['tosearch'] ) ) {
1508 1508
 			$atts['tosearch'] = 'frm-card';
@@ -1578,7 +1578,7 @@  discard block
 block discarded – undo
1578 1578
 				'new_file_path' => self::plugin_path() . '/js',
1579 1579
 			)
1580 1580
 		);
1581
-		$new_file  = new FrmCreateFile( $file_atts );
1581
+		$new_file = new FrmCreateFile( $file_atts );
1582 1582
 
1583 1583
 		$files = array(
1584 1584
 			self::plugin_path() . '/js/formidable.min.js',
@@ -1792,8 +1792,8 @@  discard block
 block discarded – undo
1792 1792
 	 */
1793 1793
 	private static function get_dropdown_value_and_label_from_option( $option, $key, $args ) {
1794 1794
 		if ( is_array( $option ) ) {
1795
-			$value = isset( $option[ $args['value_key'] ] ) ? $option[ $args['value_key'] ] : '';
1796
-			$label = isset( $option[ $args['label_key'] ] ) ? $option[ $args['label_key'] ] : '';
1795
+			$value = isset( $option[$args['value_key']] ) ? $option[$args['value_key']] : '';
1796
+			$label = isset( $option[$args['label_key']] ) ? $option[$args['label_key']] : '';
1797 1797
 		} else {
1798 1798
 			$value = $key;
1799 1799
 			$label = $option;
@@ -2176,8 +2176,8 @@  discard block
 block discarded – undo
2176 2176
 			return $error;
2177 2177
 		}
2178 2178
 
2179
-		$nonce_value = $_REQUEST && isset( $_REQUEST[ $nonce_name ] ) ? sanitize_text_field( wp_unslash( $_REQUEST[ $nonce_name ] ) ) : '';
2180
-		if ( $_REQUEST && ( ! isset( $_REQUEST[ $nonce_name ] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) {
2179
+		$nonce_value = $_REQUEST && isset( $_REQUEST[$nonce_name] ) ? sanitize_text_field( wp_unslash( $_REQUEST[$nonce_name] ) ) : '';
2180
+		if ( $_REQUEST && ( ! isset( $_REQUEST[$nonce_name] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) {
2181 2181
 			$frm_settings = self::get_settings();
2182 2182
 			$error        = $frm_settings->admin_permission;
2183 2183
 		}
@@ -2213,7 +2213,7 @@  discard block
 block discarded – undo
2213 2213
 			} else {
2214 2214
 				foreach ( $value as $k => $v ) {
2215 2215
 					if ( ! is_array( $v ) ) {
2216
-						$value[ $k ] = call_user_func( $original_function, $v );
2216
+						$value[$k] = call_user_func( $original_function, $v );
2217 2217
 					}
2218 2218
 				}
2219 2219
 			}
@@ -2254,7 +2254,7 @@  discard block
 block discarded – undo
2254 2254
 			if ( is_array( $value ) ) {
2255 2255
 				$return = array_merge( $return, self::array_flatten( $value, $keys ) );
2256 2256
 			} elseif ( $keys === 'keep' ) {
2257
-					$return[ $key ] = $value;
2257
+					$return[$key] = $value;
2258 2258
 			} else {
2259 2259
 				$return[] = $value;
2260 2260
 			}
@@ -2329,11 +2329,11 @@  discard block
 block discarded – undo
2329 2329
 		}
2330 2330
 
2331 2331
 		$ver = $default;
2332
-		if ( ! isset( $wp_scripts->registered[ $handle ] ) ) {
2332
+		if ( ! isset( $wp_scripts->registered[$handle] ) ) {
2333 2333
 			return $ver;
2334 2334
 		}
2335 2335
 
2336
-		$query = $wp_scripts->registered[ $handle ];
2336
+		$query = $wp_scripts->registered[$handle];
2337 2337
 		if ( is_object( $query ) && ! empty( $query->ver ) ) {
2338 2338
 			$ver = $query->ver;
2339 2339
 		}
@@ -2349,7 +2349,7 @@  discard block
 block discarded – undo
2349 2349
 	 * @return string|null
2350 2350
 	 */
2351 2351
 	public static function js_redirect( $url, $echo = false ) {
2352
-		$callback = function () use ( $url ) {
2352
+		$callback = function() use ( $url ) {
2353 2353
 			echo '<script type="text/javascript">window.location="' . esc_url_raw( $url ) . '"</script>';
2354 2354
 		};
2355 2355
 		return self::clip( $callback, $echo );
@@ -2444,7 +2444,7 @@  discard block
 block discarded – undo
2444 2444
 			$suffix = 2;
2445 2445
 			do {
2446 2446
 				$key_check = $key . $separator . $suffix;
2447
-				++$suffix;
2447
+				++ $suffix;
2448 2448
 			} while ( in_array( $key_check, $similar_keys, true ) );
2449 2449
 
2450 2450
 			$key = $key_check;
@@ -2552,7 +2552,7 @@  discard block
 block discarded – undo
2552 2552
 
2553 2553
 		foreach ( array( 'name', 'description' ) as $var ) {
2554 2554
 			$default_val    = isset( $record->{$var} ) ? $record->{$var} : '';
2555
-			$values[ $var ] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' );
2555
+			$values[$var] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' );
2556 2556
 			unset( $var, $default_val );
2557 2557
 		}
2558 2558
 
@@ -2608,9 +2608,9 @@  discard block
 block discarded – undo
2608 2608
 			$meta_value = FrmEntryMeta::get_meta_value( $record, $field->id );
2609 2609
 		}//end if
2610 2610
 
2611
-		$field_type = isset( $post_values['field_options'][ 'type_' . $field->id ] ) ? $post_values['field_options'][ 'type_' . $field->id ] : $field->type;
2612
-		if ( isset( $post_values['item_meta'][ $field->id ] ) ) {
2613
-			$new_value = $post_values['item_meta'][ $field->id ];
2611
+		$field_type = isset( $post_values['field_options']['type_' . $field->id] ) ? $post_values['field_options']['type_' . $field->id] : $field->type;
2612
+		if ( isset( $post_values['item_meta'][$field->id] ) ) {
2613
+			$new_value = $post_values['item_meta'][$field->id];
2614 2614
 			self::unserialize_or_decode( $new_value );
2615 2615
 		} else {
2616 2616
 			$new_value = $meta_value;
@@ -2631,7 +2631,7 @@  discard block
 block discarded – undo
2631 2631
 
2632 2632
 		$field_array = array_merge( (array) $field->field_options, $field_array );
2633 2633
 
2634
-		$values['fields'][ $field->id ] = $field_array;
2634
+		$values['fields'][$field->id] = $field_array;
2635 2635
 	}
2636 2636
 
2637 2637
 	/**
@@ -2681,11 +2681,11 @@  discard block
 block discarded – undo
2681 2681
 		}
2682 2682
 
2683 2683
 		foreach ( $form->options as $opt => $value ) {
2684
-			if ( isset( $post_values[ $opt ] ) ) {
2685
-				$values[ $opt ] = $post_values[ $opt ];
2686
-				self::unserialize_or_decode( $values[ $opt ] );
2684
+			if ( isset( $post_values[$opt] ) ) {
2685
+				$values[$opt] = $post_values[$opt];
2686
+				self::unserialize_or_decode( $values[$opt] );
2687 2687
 			} else {
2688
-				$values[ $opt ] = $value;
2688
+				$values[$opt] = $value;
2689 2689
 			}
2690 2690
 		}
2691 2691
 
@@ -2699,8 +2699,8 @@  discard block
 block discarded – undo
2699 2699
 		$form_defaults = FrmFormsHelper::get_default_opts();
2700 2700
 
2701 2701
 		foreach ( $form_defaults as $opt => $default ) {
2702
-			if ( ! isset( $values[ $opt ] ) || $values[ $opt ] == '' ) {
2703
-				$values[ $opt ] = $post_values && isset( $post_values['options'][ $opt ] ) ? $post_values['options'][ $opt ] : $default;
2702
+			if ( ! isset( $values[$opt] ) || $values[$opt] == '' ) {
2703
+				$values[$opt] = $post_values && isset( $post_values['options'][$opt] ) ? $post_values['options'][$opt] : $default;
2704 2704
 			}
2705 2705
 
2706 2706
 			unset( $opt, $default );
@@ -2711,8 +2711,8 @@  discard block
 block discarded – undo
2711 2711
 		}
2712 2712
 
2713 2713
 		foreach ( array( 'before', 'after', 'submit' ) as $h ) {
2714
-			if ( ! isset( $values[ $h . '_html' ] ) ) {
2715
-				$values[ $h . '_html' ] = ( isset( $post_values['options'][ $h . '_html' ] ) ? $post_values['options'][ $h . '_html' ] : FrmFormsHelper::get_default_html( $h ) );
2714
+			if ( ! isset( $values[$h . '_html'] ) ) {
2715
+				$values[$h . '_html'] = ( isset( $post_values['options'][$h . '_html'] ) ? $post_values['options'][$h . '_html'] : FrmFormsHelper::get_default_html( $h ) );
2716 2716
 			}
2717 2717
 			unset( $h );
2718 2718
 		}
@@ -2907,25 +2907,25 @@  discard block
 block discarded – undo
2907 2907
 		if ( ! is_numeric( $levels ) ) {
2908 2908
 			// Show time in specified unit.
2909 2909
 			$levels = self::get_unit( $levels );
2910
-			if ( isset( $time_strings[ $levels ] ) ) {
2910
+			if ( isset( $time_strings[$levels] ) ) {
2911 2911
 				$diff         = array(
2912 2912
 					$levels => self::time_format( $levels, $diff ),
2913 2913
 				);
2914 2914
 				$time_strings = array(
2915
-					$levels => $time_strings[ $levels ],
2915
+					$levels => $time_strings[$levels],
2916 2916
 				);
2917 2917
 			}
2918 2918
 			$levels = 1;
2919 2919
 		}
2920 2920
 
2921 2921
 		foreach ( $time_strings as $k => $v ) {
2922
-			if ( isset( $diff[ $k ] ) && $diff[ $k ] ) {
2923
-				$time_strings[ $k ] = $diff[ $k ] . ' ' . ( $diff[ $k ] > 1 ? $v[1] : $v[0] );
2924
-			} elseif ( isset( $diff[ $k ] ) && count( $time_strings ) === 1 ) {
2922
+			if ( isset( $diff[$k] ) && $diff[$k] ) {
2923
+				$time_strings[$k] = $diff[$k] . ' ' . ( $diff[$k] > 1 ? $v[1] : $v[0] );
2924
+			} elseif ( isset( $diff[$k] ) && count( $time_strings ) === 1 ) {
2925 2925
 				// Account for 0.
2926
-				$time_strings[ $k ] = $diff[ $k ] . ' ' . $v[1];
2926
+				$time_strings[$k] = $diff[$k] . ' ' . $v[1];
2927 2927
 			} else {
2928
-				unset( $time_strings[ $k ] );
2928
+				unset( $time_strings[$k] );
2929 2929
 			}
2930 2930
 		}
2931 2931
 
@@ -2944,8 +2944,8 @@  discard block
 block discarded – undo
2944 2944
 			'y' => 'y',
2945 2945
 			'd' => 'days',
2946 2946
 		);
2947
-		if ( isset( $return[ $unit ] ) ) {
2948
-			return $diff[ $return[ $unit ] ];
2947
+		if ( isset( $return[$unit] ) ) {
2948
+			return $diff[$return[$unit]];
2949 2949
 		}
2950 2950
 
2951 2951
 		$total = $diff['days'] * self::convert_time( 'd', $unit );
@@ -2953,11 +2953,11 @@  discard block
 block discarded – undo
2953 2953
 		$times = array( 'h', 'i', 's' );
2954 2954
 
2955 2955
 		foreach ( $times as $time ) {
2956
-			if ( ! isset( $diff[ $time ] ) ) {
2956
+			if ( ! isset( $diff[$time] ) ) {
2957 2957
 				continue;
2958 2958
 			}
2959 2959
 
2960
-			$total += $diff[ $time ] * self::convert_time( $time, $unit );
2960
+			$total += $diff[$time] * self::convert_time( $time, $unit );
2961 2961
 		}
2962 2962
 
2963 2963
 		return floor( $total );
@@ -2977,7 +2977,7 @@  discard block
 block discarded – undo
2977 2977
 			'y' => DAY_IN_SECONDS * 365.25,
2978 2978
 		);
2979 2979
 
2980
-		return $convert[ $from ] / $convert[ $to ];
2980
+		return $convert[$from] / $convert[$to];
2981 2981
 	}
2982 2982
 
2983 2983
 	/**
@@ -2985,7 +2985,7 @@  discard block
 block discarded – undo
2985 2985
 	 */
2986 2986
 	private static function get_unit( $unit ) {
2987 2987
 		$units = self::get_time_strings();
2988
-		if ( isset( $units[ $unit ] ) || is_numeric( $unit ) ) {
2988
+		if ( isset( $units[$unit] ) || is_numeric( $unit ) ) {
2989 2989
 			return $unit;
2990 2990
 		}
2991 2991
 
@@ -3101,17 +3101,17 @@  discard block
 block discarded – undo
3101 3101
 
3102 3102
 					case 1:
3103 3103
 						$l2 = $name;
3104
-						self::add_value_to_array( $name, $l2, $this_val, $vars[ $l1 ] );
3104
+						self::add_value_to_array( $name, $l2, $this_val, $vars[$l1] );
3105 3105
 						break;
3106 3106
 
3107 3107
 					case 2:
3108 3108
 						$l3 = $name;
3109
-						self::add_value_to_array( $name, $l3, $this_val, $vars[ $l1 ][ $l2 ] );
3109
+						self::add_value_to_array( $name, $l3, $this_val, $vars[$l1][$l2] );
3110 3110
 						break;
3111 3111
 
3112 3112
 					case 3:
3113 3113
 						$l4 = $name;
3114
-						self::add_value_to_array( $name, $l4, $this_val, $vars[ $l1 ][ $l2 ][ $l3 ] );
3114
+						self::add_value_to_array( $name, $l4, $this_val, $vars[$l1][$l2][$l3] );
3115 3115
 				}
3116 3116
 
3117 3117
 				unset( $this_val, $n );
@@ -3130,8 +3130,8 @@  discard block
 block discarded – undo
3130 3130
 	public static function add_value_to_array( $name, $l1, $val, &$vars ) {
3131 3131
 		if ( $name == '' ) {
3132 3132
 			$vars[] = $val;
3133
-		} elseif ( ! isset( $vars[ $l1 ] ) ) {
3134
-			$vars[ $l1 ] = $val;
3133
+		} elseif ( ! isset( $vars[$l1] ) ) {
3134
+			$vars[$l1] = $val;
3135 3135
 		}
3136 3136
 	}
3137 3137
 
@@ -3148,7 +3148,7 @@  discard block
 block discarded – undo
3148 3148
 			'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' ),
3149 3149
 		);
3150 3150
 
3151
-		if ( ! isset( $tooltips[ $name ] ) ) {
3151
+		if ( ! isset( $tooltips[$name] ) ) {
3152 3152
 			return;
3153 3153
 		}
3154 3154
 
@@ -3158,7 +3158,7 @@  discard block
 block discarded – undo
3158 3158
 			echo ' class="frm_help"';
3159 3159
 		}
3160 3160
 
3161
-		echo ' title="' . esc_attr( $tooltips[ $name ] );
3161
+		echo ' title="' . esc_attr( $tooltips[$name] );
3162 3162
 
3163 3163
 		if ( 'open' != $class ) {
3164 3164
 			echo '"';
@@ -3217,13 +3217,13 @@  discard block
 block discarded – undo
3217 3217
 	}
3218 3218
 
3219 3219
 	private static function prepare_action_slashes( $val, $key, &$post_content ) {
3220
-		if ( ! isset( $post_content[ $key ] ) || is_numeric( $val ) ) {
3220
+		if ( ! isset( $post_content[$key] ) || is_numeric( $val ) ) {
3221 3221
 			return;
3222 3222
 		}
3223 3223
 
3224 3224
 		if ( is_array( $val ) ) {
3225 3225
 			foreach ( $val as $k1 => $v1 ) {
3226
-				self::prepare_action_slashes( $v1, $k1, $post_content[ $key ] );
3226
+				self::prepare_action_slashes( $v1, $k1, $post_content[$key] );
3227 3227
 				unset( $k1, $v1 );
3228 3228
 			}
3229 3229
 		} else {
@@ -3231,7 +3231,7 @@  discard block
 block discarded – undo
3231 3231
 			$val = stripslashes( $val );
3232 3232
 
3233 3233
 			// Add backslashes before double quotes and forward slashes only
3234
-			$post_content[ $key ] = addcslashes( $val, '"\\/' );
3234
+			$post_content[$key] = addcslashes( $val, '"\\/' );
3235 3235
 		}
3236 3236
 	}
3237 3237
 
@@ -3352,14 +3352,14 @@  discard block
 block discarded – undo
3352 3352
 				continue;
3353 3353
 			}
3354 3354
 			$key = $input['name'];
3355
-			if ( isset( $formatted[ $key ] ) ) {
3356
-				if ( is_array( $formatted[ $key ] ) ) {
3357
-					$formatted[ $key ][] = $input['value'];
3355
+			if ( isset( $formatted[$key] ) ) {
3356
+				if ( is_array( $formatted[$key] ) ) {
3357
+					$formatted[$key][] = $input['value'];
3358 3358
 				} else {
3359
-					$formatted[ $key ] = array( $formatted[ $key ], $input['value'] );
3359
+					$formatted[$key] = array( $formatted[$key], $input['value'] );
3360 3360
 				}
3361 3361
 			} else {
3362
-				$formatted[ $key ] = $input['value'];
3362
+				$formatted[$key] = $input['value'];
3363 3363
 			}
3364 3364
 		}
3365 3365
 
@@ -3446,7 +3446,7 @@  discard block
 block discarded – undo
3446 3446
 	 * @return void
3447 3447
 	 */
3448 3448
 	public static function localize_script( $location ) {
3449
-		if ( ! empty( self::$localized_script_locations[ $location ] ) ) {
3449
+		if ( ! empty( self::$localized_script_locations[$location] ) ) {
3450 3450
 			return;
3451 3451
 		}
3452 3452
 
@@ -3554,7 +3554,7 @@  discard block
 block discarded – undo
3554 3554
 			}
3555 3555
 		}//end if
3556 3556
 
3557
-		self::$localized_script_locations[ $location ] = true;
3557
+		self::$localized_script_locations[$location] = true;
3558 3558
 	}
3559 3559
 
3560 3560
 	/**
@@ -4073,8 +4073,8 @@  discard block
 block discarded – undo
4073 4073
 		}
4074 4074
 
4075 4075
 		foreach ( $keys as $key ) {
4076
-			if ( isset( $values[ $key ] ) ) {
4077
-				$values[ $key ] = self::kses( $values[ $key ], 'all' );
4076
+			if ( isset( $values[$key] ) ) {
4077
+				$values[$key] = self::kses( $values[$key], 'all' );
4078 4078
 			}
4079 4079
 		}
4080 4080
 
@@ -4139,7 +4139,7 @@  discard block
 block discarded – undo
4139 4139
 				'role',
4140 4140
 				'style',
4141 4141
 			);
4142
-			$safe      = in_array( $key, $safe_keys, true );
4142
+			$safe = in_array( $key, $safe_keys, true );
4143 4143
 		}//end if
4144 4144
 
4145 4145
 		/**
@@ -4278,7 +4278,7 @@  discard block
 block discarded – undo
4278 4278
 			return 0;
4279 4279
 		}
4280 4280
 
4281
-		return strlen( $parts[ count( $parts ) - 1 ] );
4281
+		return strlen( $parts[count( $parts ) - 1] );
4282 4282
 	}
4283 4283
 
4284 4284
 	/**
@@ -4298,7 +4298,7 @@  discard block
 block discarded – undo
4298 4298
 
4299 4299
 		add_filter(
4300 4300
 			'option_gmt_offset',
4301
-			function ( $offset ) {
4301
+			function( $offset ) {
4302 4302
 				if ( ! is_string( $offset ) || is_numeric( $offset ) ) {
4303 4303
 					// Leave a valid value alone.
4304 4304
 					return $offset;
@@ -4395,7 +4395,7 @@  discard block
 block discarded – undo
4395 4395
 			return;
4396 4396
 		}
4397 4397
 
4398
-		$ajax_callback = function () use ( $option ) {
4398
+		$ajax_callback = function() use ( $option ) {
4399 4399
 			self::dismiss_warning_message( $option );
4400 4400
 		};
4401 4401
 
@@ -4405,7 +4405,7 @@  discard block
 block discarded – undo
4405 4405
 
4406 4406
 		add_filter(
4407 4407
 			'frm_message_list',
4408
-			function ( $show_messages ) use ( $message, $option ) {
4408
+			function( $show_messages ) use ( $message, $option ) {
4409 4409
 				if ( get_option( $option, false ) ) {
4410 4410
 					return $show_messages;
4411 4411
 				}
Please login to merge, or discard this patch.