|
4 | 4 | * Plugin URI: https://mailchimp.com/help/connect-or-disconnect-list-subscribe-for-wordpress/ |
5 | 5 | * Description: Add a Mailchimp signup form block, widget or shortcode to your WordPress site. |
6 | 6 | * Text Domain: mailchimp |
7 | | - * Version: 1.8.0 |
| 7 | + * Version: 1.8.1 |
8 | 8 | * Requires at least: 6.4 |
9 | 9 | * Requires PHP: 7.0 |
10 | 10 | * PHP tested up to: 8.3 |
@@ -67,7 +67,7 @@ function () { |
67 | 67 | use function Mailchimp\WordPress\Includes\Admin\{admin_notice_error, admin_notice_success}; |
68 | 68 |
|
69 | 69 | // Version constant for easy CSS refreshes |
70 | | -define( 'MCSF_VER', '1.8.0' ); |
| 70 | +define( 'MCSF_VER', '1.8.1' ); |
71 | 71 |
|
72 | 72 | // What's our permission (capability) threshold |
73 | 73 | define( 'MCSF_CAP_THRESHOLD', 'manage_options' ); |
@@ -564,15 +564,20 @@ function mailchimp_sf_change_list_if_necessary() { |
564 | 564 | return; |
565 | 565 | } |
566 | 566 |
|
| 567 | + if ( |
| 568 | + ! current_user_can( MCSF_CAP_THRESHOLD ) || |
| 569 | + ! isset( $_POST['update_mc_list_id_nonce'] ) || |
| 570 | + ! wp_verify_nonce( sanitize_key( $_POST['update_mc_list_id_nonce'] ), 'update_mc_list_id_action' ) |
| 571 | + ) { |
| 572 | + wp_die( 'Security check failed.' ); |
| 573 | + } |
| 574 | + |
567 | 575 | if ( empty( $_POST['mc_list_id'] ) ) { |
568 | 576 | $msg = esc_html__( 'Please choose a valid list', 'mailchimp' ); |
569 | 577 | admin_notice_error( $msg ); |
570 | 578 | return; |
571 | 579 | } |
572 | 580 |
|
573 | | - // Simple permission check before going through all this |
574 | | - if ( ! current_user_can( MCSF_CAP_THRESHOLD ) ) { return; } |
575 | | - |
576 | 581 | $api = mailchimp_sf_get_api(); |
577 | 582 | if ( ! $api ) { return; } |
578 | 583 |
|
|
0 commit comments