Completed
Pull Request — master (#1014)
by Stephanie
36s
created
classes/controllers/FrmFormsController.php 1 patch
Braces   +12 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1672,7 +1672,8 @@  discard block
 block discarded – undo
1672 1672
 		$vars   = array();
1673 1673
 		FrmAppHelper::include_svg();
1674 1674
 
1675
-		if ( isset( $_POST['frm_compact_fields'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
1675
+		if ( isset( $_POST['frm_compact_fields'] ) ) {
1676
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
1676 1677
 			FrmAppHelper::permission_check( 'frm_edit_forms' );
1677 1678
 
1678 1679
 			// Javascript needs to be allowed in some field settings.
@@ -1982,7 +1983,8 @@  discard block
 block discarded – undo
1982 1983
 	private static function maybe_get_form_to_show( $id ) {
1983 1984
 		$form = false;
1984 1985
 
1985
-		if ( ! empty( $id ) ) { // form id or key is set
1986
+		if ( ! empty( $id ) ) {
1987
+// form id or key is set
1986 1988
 			$form = FrmForm::getOne( $id );
1987 1989
 			if ( ! $form || $form->parent_form_id || $form->status === 'trash' ) {
1988 1990
 				$form = false;
@@ -2065,7 +2067,8 @@  discard block
 block discarded – undo
2065 2067
 	private static function get_saved_errors( $form, $params ) {
2066 2068
 		global $frm_vars;
2067 2069
 
2068
-		if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][ $form->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
2070
+		if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][ $form->id ] ) ) {
2071
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
2069 2072
 			$errors = $frm_vars['created_entries'][ $form->id ]['errors'];
2070 2073
 		} else {
2071 2074
 			$errors = array();
@@ -2218,7 +2221,8 @@  discard block
 block discarded – undo
2218 2221
 			}
2219 2222
 
2220 2223
 			if ( 'redirect' === FrmOnSubmitHelper::get_action_type( $action ) ) {
2221
-				if ( $has_redirect ) { // Do not process because we run the first redirect action only.
2224
+				if ( $has_redirect ) {
2225
+// Do not process because we run the first redirect action only.
2222 2226
 					continue;
2223 2227
 				}
2224 2228
 
@@ -2381,7 +2385,8 @@  discard block
 block discarded – undo
2381 2385
 		if ( isset( $args['ajax'] ) && $args['ajax'] && $doing_ajax && empty( $args['force_delay_redirect'] ) ) {
2382 2386
 			echo json_encode( array( 'redirect' => $success_url ) );
2383 2387
 			wp_die();
2384
-		} elseif ( ! headers_sent() && empty( $args['force_delay_redirect'] ) ) { // Not AJAX submit and there is just one On Submit action runs.
2388
+		} elseif ( ! headers_sent() && empty( $args['force_delay_redirect'] ) ) {
2389
+// Not AJAX submit and there is just one On Submit action runs.
2385 2390
 			wp_redirect( esc_url_raw( $success_url ) );
2386 2391
 			die(); // do not use wp_die or redirect fails
2387 2392
 		} else {
@@ -2405,7 +2410,8 @@  discard block
 block discarded – undo
2405 2410
 
2406 2411
 		echo FrmAppHelper::maybe_kses( $redirect_msg ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
2407 2412
 		echo '<script type="text/javascript">';
2408
-		if ( empty( $args['doing_ajax'] ) ) { // Not AJAX submit, delay JS until window.load.
2413
+		if ( empty( $args['doing_ajax'] ) ) {
2414
+// Not AJAX submit, delay JS until window.load.
2409 2415
 			echo 'window.onload=function(){';
2410 2416
 		}
2411 2417
 		echo 'setTimeout(function(){window.location="' . esc_url_raw( $args['success_url'] ) . '";}, ' . intval( $delay_time ) . ');';
Please login to merge, or discard this patch.