| @@ -89,12 +89,17 @@ | ||
| 89 | 89 | * Retrieves the value where listener is listening for. |
| 90 | 90 | * |
| 91 | 91 | * @codeCoverageIgnore |
| 92 | 92 | * |
| 93 | - * @return string The listener value. | |
| 93 | + * @return string|null The listener value or null if not set. | |
| 94 | 94 | */ |
| 95 | 95 | protected function get_listener_value() { |
| 96 | - return filter_input( INPUT_GET, 'yoast_dismiss' ); | |
| 96 | + // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reason: Normally we would need to check for a nonce here but this class is not used anymore. | |
| 97 | + if ( isset( $_GET['yoast_dismiss'] ) && is_string( $_GET['yoast_dismiss'] ) ) { | |
| 98 | + // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reason: Normally we would need to check for a nonce here but this class is not used anymore. | |
| 99 | + return sanitize_text_field( wp_unslash( $_GET['yoast_dismiss'] ) ); | |
| 100 | + } | |
| 101 | + return null; | |
| 97 | 102 | } |
| 98 | 103 | |
| 99 | 104 | /** |
| 100 | 105 | * Dismisses the notification. |
| @@ -115,7 +120,7 @@ | ||
| 115 | 120 | * @return void |
| 116 | 121 | */ |
| 117 | 122 | protected function redirect_to_dashboard() { |
| 118 | 123 | wp_safe_redirect( admin_url( 'admin.php?page=wpseo_dashboard' ) ); |
| 119 | - exit; | |
| 124 | + exit(); | |
| 120 | 125 | } |
| 121 | 126 | } |