Skip to content

Commit

Permalink
some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
liedekef committed Dec 25, 2024
1 parent bd96b55 commit 28c0c1a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions eme-countries.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand All @@ -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 ) {
Expand Down
2 changes: 1 addition & 1 deletion eme-events.php
Original file line number Diff line number Diff line change
Expand Up @@ -8613,7 +8613,7 @@ function eme_meta_box_div_event_payment_methods( $event, $is_new_event ) {
<p id='span_payment_methods'>
<?php
$configured_pgs_descriptions = eme_configured_pgs_descriptions();
if ( empty( $eme_configured_pgs_descriptions ) ) {
if ( empty( $configured_pgs_descriptions ) ) {
echo "<b>";
esc_html_e( 'No payment methods configured yet. Go in the EME payment settings and configure some.', 'events-made-easy' );
echo "</b>";
Expand Down
10 changes: 5 additions & 5 deletions eme-locations.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand Down

0 comments on commit 28c0c1a

Please sign in to comment.