GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 536cb1...455cb0 )
by Marin
7s
created
gravityforms-multiple-form-instances.php 1 patch
Spacing   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -25,8 +25,8 @@  discard block
 block discarded – undo
25 25
 	 */
26 26
 	public function __construct() {
27 27
 		// hook the HTML ID string find & replace functionality
28
-		add_filter( 'gform_get_form_filter', array( $this, 'gform_get_form_filter' ), 10, 2 );
29
-		add_filter( 'gform_confirmation', array( $this, 'gform_get_form_filter' ), 10, 2 );
28
+		add_filter('gform_get_form_filter', array($this, 'gform_get_form_filter'), 10, 2);
29
+		add_filter('gform_confirmation', array($this, 'gform_get_form_filter'), 10, 2);
30 30
 	}
31 31
 
32 32
 	/**
@@ -40,10 +40,10 @@  discard block
 block discarded – undo
40 40
 	 * @param array $form Array with the form settings.
41 41
 	 * @return string $form_string The modified form HTML string.
42 42
 	 */
43
-	public function gform_get_form_filter( $form_string, $form ) {
43
+	public function gform_get_form_filter($form_string, $form) {
44 44
 		// if form has been submitted, use the submitted ID, otherwise generate a new unique ID
45
-		if ( isset( $_POST['gform_random_id'] ) ) {
46
-			$random_id = absint( $_POST['gform_random_id'] ); // Input var okay.
45
+		if (isset($_POST['gform_random_id'])) {
46
+			$random_id = absint($_POST['gform_random_id']); // Input var okay.
47 47
 		} else {
48 48
 			$random_id = mt_rand();
49 49
 		}
@@ -53,58 +53,58 @@  discard block
 block discarded – undo
53 53
 
54 54
 		// define all occurences of the original form ID that wont hurt the form input
55 55
 		$strings = array(
56
-			' gform_wrapper'                                                   => ' gform_wrapper gform_wrapper_original_id_' . $form['id'],
57
-			"for='choice_"                                                      => "for='choice_" . $random_id . '_',
58
-			"id='label_"                                                        => "id='label_" . $random_id . '_',
59
-			"'gform_wrapper_" . $form['id'] . "'"                               => "'gform_wrapper_" . $random_id . "'",
60
-			"'gf_" . $form['id'] . "'"                                          => "'gf_" . $random_id . "'",
61
-			"'gform_" . $form['id'] . "'"                                       => "'gform_" . $random_id . "'",
62
-			"'gform_ajax_frame_" . $form['id'] . "'"                            => "'gform_ajax_frame_" . $random_id . "'",
63
-			'#gf_' . $form['id'] . "'"                                          => '#gf_' . $random_id . "'",
64
-			"'gform_fields_" . $form['id'] . "'"                                => "'gform_fields_" . $random_id . "'",
65
-			"id='field_" . $form['id'] . '_'                                    => "id='field_" . $random_id . '_',
66
-			"for='input_" . $form['id'] . '_'                                   => "for='input_" . $random_id . '_',
67
-			"id='input_" . $form['id'] . '_'                                    => "id='input_" . $random_id . '_',
68
-			"id='choice_" . $form['id'] . '_'                                   => "id='choice_" . $random_id . '_',
69
-			"'gform_submit_button_" . $form['id'] . "'"                         => "'gform_submit_button_" . $random_id . "'",
70
-			'"gf_submitting_' . $form['id'] . '"'                               => '"gf_submitting_' . $random_id . '"',
71
-			"'gf_submitting_" . $form['id'] . "'"                               => "'gf_submitting_" . $random_id . "'",
72
-			'#gform_ajax_frame_' . $form['id']                                  => '#gform_ajax_frame_' . $random_id,
73
-			'#gform_wrapper_' . $form['id']                                     => '#gform_wrapper_' . $random_id,
74
-			'#gform_' . $form['id']                                             => '#gform_' . $random_id,
75
-			"trigger('gform_post_render', [" . $form['id']                      => "trigger('gform_post_render', [" . $random_id,
76
-			'gformInitSpinner( ' . $form['id'] . ','                            => 'gformInitSpinner( ' . $random_id . ',',
77
-			"trigger('gform_page_loaded', [" . $form['id']                      => "trigger('gform_page_loaded', [" . $random_id,
78
-			"'gform_confirmation_loaded', [" . $form['id'] . ']'                => "'gform_confirmation_loaded', [" . $random_id . ']',
79
-			'gf_apply_rules(' . $form['id'] . ','                               => 'gf_apply_rules(' . $random_id . ',',
80
-			'gform_confirmation_wrapper_' . $form['id']                         => 'gform_confirmation_wrapper_' . $random_id,
81
-			'gforms_confirmation_message_' . $form['id']                        => 'gforms_confirmation_message_' . $random_id,
82
-			'gform_confirmation_message_' . $form['id']                         => 'gform_confirmation_message_' . $random_id,
83
-			'if(formId == ' . $form['id'] . ')'                                 => 'if(formId == ' . $random_id . ')',
84
-			"window['gf_form_conditional_logic'][" . $form['id'] . ']'          => "window['gf_form_conditional_logic'][" . $random_id . ']',
85
-			"trigger('gform_post_conditional_logic', [" . $form['id'] . ','     => "trigger('gform_post_conditional_logic', [" . $random_id . ',',
86
-			'gformShowPasswordStrength("input_' . $form['id'] . '_'             => 'gformShowPasswordStrength("input_' . $random_id . '_',
87
-			"gformInitChosenFields('#input_" . $form['id'] . '_'                => "gformInitChosenFields('#input_" . $random_id . '_',
88
-			"jQuery('#input_" . $form['id'] . '_'                               => "jQuery('#input_" . $random_id . '_',
89
-			'gforms_calendar_icon_input_' . $form['id'] . '_'                   => 'gforms_calendar_icon_input_' . $random_id . '_',
90
-			"id='ginput_base_price_" . $form['id'] . '_'                        => "id='ginput_base_price_" . $random_id . '_',
91
-			"id='ginput_quantity_" . $form['id'] . '_'                          => "id='ginput_quantity_" . $random_id . '_',
92
-			'gfield_price_' . $form['id'] . '_'                                 => 'gfield_price_' . $random_id . '_',
93
-			'gfield_quantity_' . $form['id'] . '_'                              => 'gfield_quantity_' . $random_id . '_',
94
-			'gfield_product_' . $form['id'] . '_'                               => 'gfield_product_' . $random_id . '_',
95
-			'ginput_total_' . $form['id']                                       => 'ginput_total_' . $random_id,
96
-			'GFCalc(' . $form['id'] . ','                                       => 'GFCalc(' . $random_id . ',',
97
-			'gf_global["number_formats"][' . $form['id'] . ']'                  => 'gf_global["number_formats"][' . $random_id . ']',
98
-			'gform_next_button_' . $form['id'] . '_'                            => 'gform_next_button_' . $random_id . '_',
99
-			$hidden_field                                                       => "<input type='hidden' name='gform_random_id' value='" . $random_id . "' />" . $hidden_field,
56
+			' gform_wrapper'                                                   => ' gform_wrapper gform_wrapper_original_id_'.$form['id'],
57
+			"for='choice_"                                                      => "for='choice_".$random_id.'_',
58
+			"id='label_"                                                        => "id='label_".$random_id.'_',
59
+			"'gform_wrapper_".$form['id']."'"                               => "'gform_wrapper_".$random_id."'",
60
+			"'gf_".$form['id']."'"                                          => "'gf_".$random_id."'",
61
+			"'gform_".$form['id']."'"                                       => "'gform_".$random_id."'",
62
+			"'gform_ajax_frame_".$form['id']."'"                            => "'gform_ajax_frame_".$random_id."'",
63
+			'#gf_'.$form['id']."'"                                          => '#gf_'.$random_id."'",
64
+			"'gform_fields_".$form['id']."'"                                => "'gform_fields_".$random_id."'",
65
+			"id='field_".$form['id'].'_'                                    => "id='field_".$random_id.'_',
66
+			"for='input_".$form['id'].'_'                                   => "for='input_".$random_id.'_',
67
+			"id='input_".$form['id'].'_'                                    => "id='input_".$random_id.'_',
68
+			"id='choice_".$form['id'].'_'                                   => "id='choice_".$random_id.'_',
69
+			"'gform_submit_button_".$form['id']."'"                         => "'gform_submit_button_".$random_id."'",
70
+			'"gf_submitting_'.$form['id'].'"'                               => '"gf_submitting_'.$random_id.'"',
71
+			"'gf_submitting_".$form['id']."'"                               => "'gf_submitting_".$random_id."'",
72
+			'#gform_ajax_frame_'.$form['id']                                  => '#gform_ajax_frame_'.$random_id,
73
+			'#gform_wrapper_'.$form['id']                                     => '#gform_wrapper_'.$random_id,
74
+			'#gform_'.$form['id']                                             => '#gform_'.$random_id,
75
+			"trigger('gform_post_render', [".$form['id']                      => "trigger('gform_post_render', [".$random_id,
76
+			'gformInitSpinner( '.$form['id'].','                            => 'gformInitSpinner( '.$random_id.',',
77
+			"trigger('gform_page_loaded', [".$form['id']                      => "trigger('gform_page_loaded', [".$random_id,
78
+			"'gform_confirmation_loaded', [".$form['id'].']'                => "'gform_confirmation_loaded', [".$random_id.']',
79
+			'gf_apply_rules('.$form['id'].','                               => 'gf_apply_rules('.$random_id.',',
80
+			'gform_confirmation_wrapper_'.$form['id']                         => 'gform_confirmation_wrapper_'.$random_id,
81
+			'gforms_confirmation_message_'.$form['id']                        => 'gforms_confirmation_message_'.$random_id,
82
+			'gform_confirmation_message_'.$form['id']                         => 'gform_confirmation_message_'.$random_id,
83
+			'if(formId == '.$form['id'].')'                                 => 'if(formId == '.$random_id.')',
84
+			"window['gf_form_conditional_logic'][".$form['id'].']'          => "window['gf_form_conditional_logic'][".$random_id.']',
85
+			"trigger('gform_post_conditional_logic', [".$form['id'].','     => "trigger('gform_post_conditional_logic', [".$random_id.',',
86
+			'gformShowPasswordStrength("input_'.$form['id'].'_'             => 'gformShowPasswordStrength("input_'.$random_id.'_',
87
+			"gformInitChosenFields('#input_".$form['id'].'_'                => "gformInitChosenFields('#input_".$random_id.'_',
88
+			"jQuery('#input_".$form['id'].'_'                               => "jQuery('#input_".$random_id.'_',
89
+			'gforms_calendar_icon_input_'.$form['id'].'_'                   => 'gforms_calendar_icon_input_'.$random_id.'_',
90
+			"id='ginput_base_price_".$form['id'].'_'                        => "id='ginput_base_price_".$random_id.'_',
91
+			"id='ginput_quantity_".$form['id'].'_'                          => "id='ginput_quantity_".$random_id.'_',
92
+			'gfield_price_'.$form['id'].'_'                                 => 'gfield_price_'.$random_id.'_',
93
+			'gfield_quantity_'.$form['id'].'_'                              => 'gfield_quantity_'.$random_id.'_',
94
+			'gfield_product_'.$form['id'].'_'                               => 'gfield_product_'.$random_id.'_',
95
+			'ginput_total_'.$form['id']                                       => 'ginput_total_'.$random_id,
96
+			'GFCalc('.$form['id'].','                                       => 'GFCalc('.$random_id.',',
97
+			'gf_global["number_formats"]['.$form['id'].']'                  => 'gf_global["number_formats"]['.$random_id.']',
98
+			'gform_next_button_'.$form['id'].'_'                            => 'gform_next_button_'.$random_id.'_',
99
+			$hidden_field                                                       => "<input type='hidden' name='gform_random_id' value='".$random_id."' />".$hidden_field,
100 100
 		);
101 101
 
102 102
 		// allow addons & plugins to add additional find & replace strings
103
-		$strings = apply_filters( 'gform_multiple_instances_strings', $strings, $form['id'], $random_id );
103
+		$strings = apply_filters('gform_multiple_instances_strings', $strings, $form['id'], $random_id);
104 104
 
105 105
 		// replace all occurences with the new unique ID
106
-		foreach ( $strings as $find => $replace ) {
107
-			$form_string = str_replace( $find, $replace, $form_string );
106
+		foreach ($strings as $find => $replace) {
107
+			$form_string = str_replace($find, $replace, $form_string);
108 108
 		}
109 109
 
110 110
 		return $form_string;
Please login to merge, or discard this patch.