|
@@ -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
|
|
|
@@ -2402,12 +2406,14 @@ discard block |
|
|
block discarded – undo |
|
2402
|
2406
|
|
|
2403
|
2407
|
$doing_ajax = FrmAppHelper::doing_ajax(); |
|
2404
|
2408
|
|
|
2405
|
|
- if ( ! empty( $args['ajax'] ) && $doing_ajax && empty( $args['force_delay_redirect'] ) ) { // Is AJAX submit and there is just one Redirect action runs. |
|
|
2409
|
+ if ( ! empty( $args['ajax'] ) && $doing_ajax && empty( $args['force_delay_redirect'] ) ) { |
|
|
2410
|
+// Is AJAX submit and there is just one Redirect action runs. |
|
2406
|
2411
|
echo json_encode( array( 'redirect' => $success_url ) ); |
|
2407
|
2412
|
wp_die(); |
|
2408
|
2413
|
} |
|
2409
|
2414
|
|
|
2410
|
|
- if ( ! headers_sent() && empty( $args['force_delay_redirect'] ) ) { // Not AJAX submit, no headers sent, and there is just one Redirect action runs. |
|
|
2415
|
+ if ( ! headers_sent() && empty( $args['force_delay_redirect'] ) ) { |
|
|
2416
|
+// Not AJAX submit, no headers sent, and there is just one Redirect action runs. |
|
2411
|
2417
|
wp_redirect( esc_url_raw( $success_url ) ); |
|
2412
|
2418
|
die(); // do not use wp_die or redirect fails |
|
2413
|
2419
|
} |
|
@@ -2432,7 +2438,8 @@ discard block |
|
|
block discarded – undo |
|
2432
|
2438
|
|
|
2433
|
2439
|
echo FrmAppHelper::maybe_kses( $redirect_msg ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
|
2434
|
2440
|
echo '<script>'; |
|
2435
|
|
- if ( empty( $args['doing_ajax'] ) ) { // Not AJAX submit, delay JS until window.load. |
|
|
2441
|
+ if ( empty( $args['doing_ajax'] ) ) { |
|
|
2442
|
+// Not AJAX submit, delay JS until window.load. |
|
2436
|
2443
|
echo 'window.onload=function(){'; |
|
2437
|
2444
|
} |
|
2438
|
2445
|
echo 'setTimeout(function(){window.location="' . esc_url_raw( $args['success_url'] ) . '";}, ' . intval( $delay_time ) . ');'; |