Skip to content

Commit 3619ac5

Browse files
committed
Check that list data is sent
1 parent 8c0152f commit 3619ac5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

mailchimp.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,11 @@ function mailchimp_sf_save_general_form_settings() {
634634
* Sees if the user changed the list, and updates options accordingly
635635
**/
636636
function mailchimp_sf_change_list_if_necessary() {
637-
if ( empty( $_POST['mc_list_id'] ) ) {
637+
if ( ! isset( $_POST['mc_list_id'] ) ) {
638+
return;
639+
}
640+
641+
if ( isset( $_POST['mc_list_id'] ) && empty( $_POST['mc_list_id'] ) ) {
638642
$msg = '<p class="error_msg">' . esc_html__( 'Please choose a valid list', 'mailchimp' ) . '</p>';
639643
mailchimp_sf_global_msg( $msg );
640644
return;

0 commit comments

Comments
 (0)