@@ -1107,6 +1107,7 @@ public function custom_selected_fields( $form_type ) {
11071107 ?>
11081108 <input type="hidden" name="form_type" id="form_type" value="<?php echo esc_attr ( $ form_type ); ?> "/>
11091109 <input type="hidden" name="manage_field_type" class="manage_field_type" value="custom_fields">
1110+ <input type="hidden" name="uwp_create_field_nonce" class="uwp_create_field_nonce" value="<?php echo wp_create_nonce ( 'uwp_create_field_nonce ' ); ?> "/>
11101111 <ul class="core uwp-tabs-selected uwp_form_extras ps-0 list-group">
11111112 <?php
11121113 // Retrieve fields saved with form id 0.
@@ -1852,6 +1853,7 @@ public function register_selected_fields( $form_type ) {
18521853 $ form_id = self ::get_form_id ()
18531854 ?>
18541855 <input type="hidden" name="manage_field_type" class="manage_field_type" value="register">
1856+ <input type="hidden" name="uwp_create_field_nonce" class="uwp_create_field_nonce" value="<?php echo wp_create_nonce ( 'uwp_create_field_nonce ' ); ?> "/>
18551857 <ul class="core uwp_form_extras uwp-tabs-selected ps-0 list-group ">
18561858 <?php
18571859
@@ -2522,7 +2524,10 @@ public function create_field() {
25222524
25232525 /* ------- check nonce field ------- */
25242526 if ( isset ( $ _REQUEST ['update ' ] ) && $ _REQUEST ['update ' ] == 'update ' && isset ( $ _REQUEST ['create_field ' ] ) && isset ( $ _REQUEST ['manage_field_type ' ] ) && $ _REQUEST ['manage_field_type ' ] == 'custom_fields ' ) {
2525- echo $ this ->set_field_order ( $ field_ids , $ form_id ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
2527+ if ( ! wp_verify_nonce ( $ _REQUEST ['_wpnonce ' ], 'uwp_create_field_nonce ' ) ) {
2528+ return ;
2529+ }
2530+ echo $ this ->set_field_order ( $ field_ids , $ form_id ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
25262531 }
25272532
25282533 /* ---- Show field form in admin ---- */
@@ -3211,8 +3216,12 @@ public function register_ajax_handler() {
32113216 $ field_id = isset ( $ _REQUEST ['field_id ' ] ) ? trim ( sanitize_text_field ( $ _REQUEST ['field_id ' ] ), '_ ' ) : '' ;
32123217 $ field_action = isset ( $ _REQUEST ['field_ins_upd ' ] ) ? sanitize_text_field ( $ _REQUEST ['field_ins_upd ' ] ) : '' ;
32133218
3214- /* ------- check nonce field ------- */
3215- if ( isset ( $ _REQUEST ['update ' ] ) && $ _REQUEST ['update ' ] == 'update ' ) {
3219+ /* ------- update order of fields ------- */
3220+ if ( isset ( $ _REQUEST ['update ' ] ) && $ _REQUEST ['update ' ] == 'update ' && isset ( $ _REQUEST ['_wpnonce ' ] )) {
3221+ if ( ! wp_verify_nonce ( $ _REQUEST ['_wpnonce ' ], 'uwp_create_field_nonce ' ) ) {
3222+ return ;
3223+ }
3224+
32163225 $ field_ids = array ();
32173226 if ( ! empty ( $ _REQUEST ['licontainer ' ] ) && is_array ( $ _REQUEST ['licontainer ' ] ) ) {
32183227 foreach ( $ _REQUEST ['licontainer ' ] as $ lic_id ) {
0 commit comments