From 28c0c1a9d50906026511ab64ff708962b3bc4720 Mon Sep 17 00:00:00 2001 From: Franky Van Liedekerke Date: Wed, 25 Dec 2024 21:36:24 +0100 Subject: [PATCH] some fixes --- eme-countries.php | 6 +++--- eme-events.php | 2 +- eme-locations.php | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/eme-countries.php b/eme-countries.php index 2306704f..379cedfa 100644 --- a/eme-countries.php +++ b/eme-countries.php @@ -1053,8 +1053,8 @@ function eme_ajax_state_edit() { add_action( 'wp_ajax_nopriv_eme_select_state', 'eme_select_state_ajax' ); function eme_select_state_ajax() { check_ajax_referer( 'eme_frontend', 'eme_frontend_nonce' ); - $q = isset( $_POST['q'] ) ? eme_sanitize_request( $_POST['q'] ) : ''; - $country_code = isset( $_POST['country_code'] ) ? eme_sanitize_request( $_POST['country_code'] ) : ''; + $q = isset( $_REQUEST['q'] ) ? eme_sanitize_request( $_REQUEST['q'] ) : ''; + $country_code = isset( $_REQUEST['country_code'] ) ? eme_sanitize_request( $_REQUEST['country_code'] ) : ''; // the country code can be empty, in which case eme_get_localized_states will return states if only 1 country exists $records = []; $states = eme_get_localized_states( $country_code ); @@ -1078,7 +1078,7 @@ function eme_select_state_ajax() { add_action( 'wp_ajax_nopriv_eme_select_country', 'eme_select_country_ajax' ); function eme_select_country_ajax() { check_ajax_referer( 'eme_frontend', 'eme_frontend_nonce' ); - $q = isset( $_POST['q'] ) ? eme_sanitize_request( $_POST['q'] ) : ''; + $q = isset( $_REQUEST['q'] ) ? eme_sanitize_request( $_REQUEST['q'] ) : ''; $records = []; $countries = eme_get_localized_countries(); foreach ( $countries as $country ) { diff --git a/eme-events.php b/eme-events.php index 69983439..ff0da585 100644 --- a/eme-events.php +++ b/eme-events.php @@ -8613,7 +8613,7 @@ function eme_meta_box_div_event_payment_methods( $event, $is_new_event ) {

"; esc_html_e( 'No payment methods configured yet. Go in the EME payment settings and configure some.', 'events-made-easy' ); echo ""; diff --git a/eme-locations.php b/eme-locations.php index d41afcf3..49c1355f 100644 --- a/eme-locations.php +++ b/eme-locations.php @@ -2818,19 +2818,19 @@ function eme_locations_search_ajax() { function eme_locations_autocomplete_ajax( $no_wp_die = 0 ) { if ( $no_wp_die == 0 ) { - if ( ( ! isset( $_POST['eme_admin_nonce'] ) && ! isset( $_POST['eme_frontend_nonce'] ) ) || - ( isset( $_POST['eme_admin_nonce'] ) && ! wp_verify_nonce( $_POST['eme_admin_nonce'], 'eme_admin' ) ) || - ( isset( $_POST['eme_frontend_nonce'] ) && ! wp_verify_nonce( $_POST['eme_frontend_nonce'], 'eme_frontend' ) ) ) { + if ( ( ! isset( $_REQUEST['eme_admin_nonce'] ) && ! isset( $_REQUEST['eme_frontend_nonce'] ) ) || + ( isset( $_REQUEST['eme_admin_nonce'] ) && ! wp_verify_nonce( $_REQUEST['eme_admin_nonce'], 'eme_admin' ) ) || + ( isset( $_REQUEST['eme_frontend_nonce'] ) && ! wp_verify_nonce( $_REQUEST['eme_frontend_nonce'], 'eme_frontend' ) ) ) { wp_die(); } } $res = []; - if ( ! isset( $_POST['name'] ) ) { + if ( ! isset( $_REQUEST['name'] ) ) { echo wp_json_encode( $res ); return; } - $locations = eme_search_locations( eme_sanitize_request($_POST['name']) ); + $locations = eme_search_locations( eme_sanitize_request($_REQUEST['name']) ); // change null to empty $locations = array_map( function( $v ) {