PluginProbe
Better Payment – Instant Payments, Donations, Fundraising with Subscriptions & More / 2.4.1
Better Payment – Instant Payments, Donations, Fundraising with Subscriptions & More v2.4.1
2.4.1 2.4.0 2.3.4 2.3.3 2.3.2 2.3.1 2.3.0 2.2.2 2.2.1 2.2.0 2.1.2 2.1.1 trunk 0.0.1 0.0.2 0.0.3 0.0.4 0.0.5 0.0.6 0.0.7 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 All 68 releases
← All changes | includes/Classes/Plugin_Usage_Tracker.php +8 -2 2.3.3 → 2.4.1 View file →
@@ -825,14 +825,20 @@
825 825 */
826 826 public function deactivate_reasons_form_submit()
827 827 {
828 828 check_ajax_referer('wpins_deactivation_nonce', 'security');
829 + // Better Payment hardening (not upstream): a nonce is not a permission, so only a user
830 + // who can deactivate plugins may write these options — and what they write is stored as
831 + // plain text, never as whatever structure the request carried.
832 + if ( ! current_user_can( 'activate_plugins' ) ) {
833 + wp_send_json_error( null, 403 );
834 + }
829 835 if (isset($_POST['values'])) {
830 - $values = $_POST['values'];
836 + $values = is_scalar( $_POST['values'] ) ? sanitize_text_field( wp_unslash( $_POST['values'] ) ) : '';
831 837 update_option('wpins_deactivation_reason_' . $this->plugin_name, $values);
832 838 }
833 839 if (isset($_POST['details'])) {
834 - $details = sanitize_text_field($_POST['details']);
840 + $details = is_scalar( $_POST['details'] ) ? sanitize_text_field( wp_unslash( $_POST['details'] ) ) : '';
835 841 update_option('wpins_deactivation_details_' . $this->plugin_name, $details);
836 842 }
837 843 echo 'success';
838 844 wp_die();