| @@ -55,14 +55,19 @@ | ||
| 55 | 55 | { |
| 56 | 56 | check_ajax_referer('logtivity_dismiss_notice'); |
| 57 | 57 | |
| 58 | 58 | if (!current_user_can(Logtivity::ACCESS_SETTINGS)) { |
| 59 | - wp_die(__('You do not have sufficient permissions to access this page.')); | |
| 59 | + wp_die(esc_html__('You do not have sufficient permissions to access this page.', 'logtivity')); | |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | - $postType = sanitize_text_field($_POST['postType'] ?? null); | |
| 63 | - if (in_array($postType, $this->notices)) { | |
| 64 | - $dismissUntil = sanitize_text_field($_POST['dismissUntil'] ?? null); | |
| 62 | + $postType = isset($_POST['postType']) | |
| 63 | + ? sanitize_text_field(wp_unslash($_POST['postType'])) | |
| 64 | + : null; | |
| 65 | + | |
| 66 | + if (in_array($postType, $this->notices, true)) { | |
| 67 | + $dismissUntil = isset($_POST['dismissUntil']) | |
| 68 | + ? sanitize_text_field(wp_unslash($_POST['dismissUntil'])) | |
| 69 | + : null; | |
| 65 | 70 | |
| 66 | 71 | if ($dismissUntil) { |
| 67 | 72 | set_transient( |
| 68 | 73 | 'dismissed-' . $postType, |