← All changes
|
includes/core/shortcodes/class-wpfnl-shortcode-optin.php
+10
-2
3.12.7
→
3.13.3
View file →
| @@ -156,15 +156,23 @@ | ||
| 156 | 156 | $site_secret_key = isset($recaptcha_setting['recaptcha_site_secret']) ? $recaptcha_setting['recaptcha_site_secret'] : ''; |
| 157 | 157 | $token_input = ''; |
| 158 | 158 | $recaptch_script = ''; |
| 159 | 159 | $is_recaptch_input = ''; |
| 160 | - $token_secret_key = ''; | |
| 161 | 160 | if('on' == $is_recaptch && '' != $site_key && '' != $site_secret_key){ |
| 162 | 161 | $is_recaptch_input = '<input type="hidden" id="wpf-is-recapcha" name="wpf-is-recapcha" value="'.$is_recaptch.'"/>'; |
| 163 | 162 | $token_input = '<input type="hidden" id="wpf-optin-g-token" name="wpf-optin-g-token" />'; |
| 164 | - $token_secret_key = '<input type="hidden" id="wpf-optin-g-secret-key" name="wpf-optin-g-secret-key" value="'.$site_secret_key.'" />'; | |
| 165 | 163 | $recaptch_script = '<script src="https://www.google.com/recaptcha/api.js?render='.$site_key.'"></script>'; |
| 166 | 164 | } |
| 165 | + | |
| 166 | + // Sign the settings this form was rendered with. The submission handler | |
| 167 | + // trusts the recipient, subject and registration switch only when they | |
| 168 | + // still match what was configured here. | |
| 169 | + $optin_settings_token = Wpfnl_functions::get_optin_settings_token( | |
| 170 | + isset( $this->attributes['admin_email'] ) ? $this->attributes['admin_email'] : '', | |
| 171 | + isset( $this->attributes['admin_email_subject'] ) ? $this->attributes['admin_email_subject'] : '', | |
| 172 | + isset( $this->attributes['register_as_subscriber'] ) && 'true' == $this->attributes['register_as_subscriber'] ? 'yes' : '' | |
| 173 | + ); | |
| 174 | + | |
| 167 | 175 | ob_start(); |
| 168 | 176 | do_action( 'wpfunnels/before_optin_form' ); |
| 169 | 177 | require WPFNL_DIR.'/includes/core/shortcodes/templates/optin/form.php'; |
| 170 | 178 | do_action( 'wpfunnels/after_optin_form' ); |