| @@ -16,9 +16,9 @@ | ||
| 16 | 16 | * !DO NOT CHANGE THIS! |
| 17 | 17 | * |
| 18 | 18 | * @var string |
| 19 | 19 | */ |
| 20 | - const PAGE_IDENTIFIER = 'wpseo_dashboard'; | |
| 20 | + public const PAGE_IDENTIFIER = 'wpseo_dashboard'; | |
| 21 | 21 | |
| 22 | 22 | /** |
| 23 | 23 | * List of classes that add admin functionality. |
| 24 | 24 | * |
| @@ -58,10 +58,14 @@ | ||
| 58 | 58 | * |
| 59 | 59 | * @return void |
| 60 | 60 | */ |
| 61 | 61 | public function load_page() { |
| 62 | - $page = filter_input( INPUT_GET, 'page' ); | |
| 63 | - $this->show_page( $page ); | |
| 62 | + // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reason: We are not processing form information. | |
| 63 | + if ( isset( $_GET['page'] ) && is_string( $_GET['page'] ) ) { | |
| 64 | + // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reason: We are not processing form information. | |
| 65 | + $page = sanitize_text_field( wp_unslash( $_GET['page'] ) ); | |
| 66 | + $this->show_page( $page ); | |
| 67 | + } | |
| 64 | 68 | } |
| 65 | 69 | |
| 66 | 70 | /** |
| 67 | 71 | * Shows an admin settings page. |
| @@ -75,26 +79,13 @@ | ||
| 75 | 79 | case 'wpseo_tools': |
| 76 | 80 | require_once WPSEO_PATH . 'admin/pages/tools.php'; |
| 77 | 81 | break; |
| 78 | 82 | |
| 79 | - case 'wpseo_titles': | |
| 80 | - require_once WPSEO_PATH . 'admin/pages/metas.php'; | |
| 81 | - break; | |
| 82 | - | |
| 83 | - case 'wpseo_social': | |
| 84 | - require_once WPSEO_PATH . 'admin/pages/social.php'; | |
| 85 | - break; | |
| 86 | - | |
| 87 | - case 'wpseo_licenses': | |
| 88 | - require_once WPSEO_PATH . 'admin/pages/licenses.php'; | |
| 89 | - break; | |
| 90 | - | |
| 91 | 83 | case 'wpseo_files': |
| 92 | 84 | require_once WPSEO_PATH . 'admin/views/tool-file-editor.php'; |
| 93 | 85 | break; |
| 94 | 86 | |
| 95 | 87 | default: |
| 96 | - require_once WPSEO_PATH . 'admin/pages/dashboard.php'; | |
| 97 | 88 | break; |
| 98 | 89 | } |
| 99 | 90 | } |
| 100 | 91 | } |