|
3 | 3 | Plugin Name: MailChimp |
4 | 4 | Plugin URI: http://www.mailchimp.com/plugins/mailchimp-wordpress-plugin/ |
5 | 5 | Description: The MailChimp plugin allows you to quickly and easily add a signup form for your MailChimp list. |
6 | | -Version: 1.5.8 |
| 6 | +Version: 1.5.9 |
7 | 7 | Author: MailChimp |
8 | 8 | Author URI: https://mailchimp.com/ |
9 | 9 | */ |
|
25 | 25 | */ |
26 | 26 |
|
27 | 27 | // Version constant for easy CSS refreshes |
28 | | -define('MCSF_VER', '1.5.8'); |
| 28 | +define('MCSF_VER', '1.5.9'); |
29 | 29 |
|
30 | 30 | // What's our permission (capability) threshold |
31 | 31 | define('MCSF_CAP_THRESHOLD', 'manage_options'); |
@@ -185,6 +185,14 @@ function mailchimpSF_request_handler() { |
185 | 185 | if (isset($_POST['mcsf_action'])) { |
186 | 186 | switch ($_POST['mcsf_action']) { |
187 | 187 | case 'login': |
| 188 | + if ( |
| 189 | + ! current_user_can( MCSF_CAP_THRESHOLD ) || |
| 190 | + ! isset( $_POST['_mcsf_nonce_action'] ) || |
| 191 | + ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['_mcsf_nonce_action'] ) ), 'mc_login' ) |
| 192 | + ) { |
| 193 | + wp_die('Security check failed.'); |
| 194 | + } |
| 195 | + |
188 | 196 | $key = trim($_POST['mailchimpSF_api_key']); |
189 | 197 |
|
190 | 198 | try { |
@@ -572,8 +580,17 @@ function mailchimpSF_save_general_form_settings() { |
572 | 580 | * Sees if the user changed the list, and updates options accordingly |
573 | 581 | **/ |
574 | 582 | function mailchimpSF_change_list_if_necessary() { |
575 | | - // Simple permission check before going through all this |
576 | | - if (!current_user_can(MCSF_CAP_THRESHOLD)) { return; } |
| 583 | + if ( ! isset( $_POST['mc_list_id'] ) ) { |
| 584 | + return; |
| 585 | + } |
| 586 | + |
| 587 | + if ( |
| 588 | + ! current_user_can( MCSF_CAP_THRESHOLD ) || |
| 589 | + ! isset( $_POST['update_mc_list_id_nonce'] ) || |
| 590 | + ! wp_verify_nonce( sanitize_key( $_POST['update_mc_list_id_nonce'] ), 'update_mc_list_id_action' ) |
| 591 | + ) { |
| 592 | + wp_die( 'Security check failed.' ); |
| 593 | + } |
577 | 594 |
|
578 | 595 | $api = mailchimpSF_get_api(); |
579 | 596 | if (!$api) { return; } |
|
0 commit comments