diff --git a/includes/core/class-files.php b/includes/core/class-files.php index f5f71a90..8a702456 100644 --- a/includes/core/class-files.php +++ b/includes/core/class-files.php @@ -339,8 +339,8 @@ if ( ! class_exists( 'um\core\Files' ) ) { $user_id = empty( $_REQUEST['user_id'] ) ? get_current_user_id() : absint( $_REQUEST['user_id'] ); - UM()->fields()->set_id = filter_input( INPUT_POST, 'set_id', FILTER_SANITIZE_NUMBER_INT ); - UM()->fields()->set_mode = filter_input( INPUT_POST, 'set_mode', FILTER_SANITIZE_STRING ); + UM()->fields()->set_id = isset( $_POST['set_id'] ) ? absint( $_POST['set_id'] ) : null; + UM()->fields()->set_mode = isset( $_POST['set_mode'] ) ? sanitize_text_field( $_POST['set_mode'] ) : null; if ( UM()->fields()->set_mode != 'register' && ! UM()->roles()->um_current_user_can( 'edit', $user_id ) ) { $ret['error'] = esc_js( __( 'You have no permission to edit this user', 'ultimate-member' ) ); diff --git a/includes/core/class-member-directory.php b/includes/core/class-member-directory.php index 6c403722..b04cbca9 100644 --- a/includes/core/class-member-directory.php +++ b/includes/core/class-member-directory.php @@ -634,13 +634,16 @@ if ( ! class_exists( 'um\core\Member_Directory' ) ) { if ( isset( $_GET[ 'filter_' . $attrs['parent_dropdown_relationship'] . '_' . $unique_hash ] ) ) { $_POST['parent_option_name'] = $attrs['parent_dropdown_relationship']; - $_POST['parent_option'] = explode( '||', filter_input( INPUT_GET, 'filter_' . $attrs['parent_dropdown_relationship'] . '_' . $unique_hash ) ); + + $parent_option_value = sanitize_text_field( $_GET[ 'filter_' . $attrs['parent_dropdown_relationship'] . '_' . $unique_hash ] ); + $_POST['parent_option'] = explode( '||', $parent_option_value ); } } $attrs['custom_dropdown_options_source'] = wp_unslash( $attrs['custom_dropdown_options_source'] ); $ajax_source = apply_filters( "um_custom_dropdown_options_source__{$filter}", $attrs['custom_dropdown_options_source'], $attrs ); + $custom_dropdown .= ' data-um-ajax-source="' . esc_attr( $ajax_source ) . '" '; $attrs['options'] = UM()->fields()->get_options_from_callback( $attrs, $attrs['type'] );