|
@@ -1697,7 +1697,8 @@ discard block |
|
|
block discarded – undo |
|
1697
|
1697
|
$vars = array(); |
|
1698
|
1698
|
FrmAppHelper::include_svg(); |
|
1699
|
1699
|
|
|
1700
|
|
- if ( isset( $_POST['frm_compact_fields'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
|
1700
|
+ if ( isset( $_POST['frm_compact_fields'] ) ) { |
|
|
1701
|
+// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
1701
|
1702
|
FrmAppHelper::permission_check( 'frm_edit_forms' ); |
|
1702
|
1703
|
|
|
1703
|
1704
|
// Javascript needs to be allowed in some field settings. |
|
@@ -2007,7 +2008,8 @@ discard block |
|
|
block discarded – undo |
|
2007
|
2008
|
private static function maybe_get_form_to_show( $id ) { |
|
2008
|
2009
|
$form = false; |
|
2009
|
2010
|
|
|
2010
|
|
- if ( ! empty( $id ) ) { // form id or key is set |
|
|
2011
|
+ if ( ! empty( $id ) ) { |
|
|
2012
|
+// form id or key is set |
|
2011
|
2013
|
$form = FrmForm::getOne( $id ); |
|
2012
|
2014
|
if ( ! $form || $form->parent_form_id || $form->status === 'trash' ) { |
|
2013
|
2015
|
$form = false; |
|
@@ -2090,7 +2092,8 @@ discard block |
|
|
block discarded – undo |
|
2090
|
2092
|
private static function get_saved_errors( $form, $params ) { |
|
2091
|
2093
|
global $frm_vars; |
|
2092
|
2094
|
|
|
2093
|
|
- if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][ $form->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
|
2095
|
+ if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][ $form->id ] ) ) { |
|
|
2096
|
+// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
2094
|
2097
|
$errors = $frm_vars['created_entries'][ $form->id ]['errors']; |
|
2095
|
2098
|
} else { |
|
2096
|
2099
|
$errors = array(); |
|
@@ -2243,7 +2246,8 @@ discard block |
|
|
block discarded – undo |
|
2243
|
2246
|
} |
|
2244
|
2247
|
|
|
2245
|
2248
|
if ( 'redirect' === FrmOnSubmitHelper::get_action_type( $action ) ) { |
|
2246
|
|
- if ( $has_redirect ) { // Do not process because we run the first redirect action only. |
|
|
2249
|
+ if ( $has_redirect ) { |
|
|
2250
|
+// Do not process because we run the first redirect action only. |
|
2247
|
2251
|
continue; |
|
2248
|
2252
|
} |
|
2249
|
2253
|
|
|
@@ -2412,7 +2416,8 @@ discard block |
|
|
block discarded – undo |
|
2412
|
2416
|
) |
|
2413
|
2417
|
); |
|
2414
|
2418
|
wp_die(); |
|
2415
|
|
- } elseif ( ! headers_sent() && empty( $args['time_to_read'] ) ) { // Not AJAX submit and there is just one On Submit action runs. |
|
|
2419
|
+ } elseif ( ! headers_sent() && empty( $args['time_to_read'] ) ) { |
|
|
2420
|
+// Not AJAX submit and there is just one On Submit action runs. |
|
2416
|
2421
|
wp_redirect( esc_url_raw( $success_url ) ); |
|
2417
|
2422
|
die(); // do not use wp_die or redirect fails |
|
2418
|
2423
|
} |
|
@@ -2437,7 +2442,8 @@ discard block |
|
|
block discarded – undo |
|
2437
|
2442
|
|
|
2438
|
2443
|
echo FrmAppHelper::maybe_kses( $redirect_msg ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
|
2439
|
2444
|
echo '<script>'; |
|
2440
|
|
- if ( empty( $args['doing_ajax'] ) ) { // Not AJAX submit, delay JS until window.load. |
|
|
2445
|
+ if ( empty( $args['doing_ajax'] ) ) { |
|
|
2446
|
+// Not AJAX submit, delay JS until window.load. |
|
2441
|
2447
|
echo 'window.onload=function(){'; |
|
2442
|
2448
|
} |
|
2443
|
2449
|
echo 'setTimeout(function(){window.location="' . esc_url_raw( $args['success_url'] ) . '";}, ' . intval( $delay_time ) . ');'; |