From 1cd57dd24b7418602dea56867318b5f5b9dbed31 Mon Sep 17 00:00:00 2001 From: arunshenoy99 Date: Wed, 5 Apr 2023 19:20:46 +0530 Subject: [PATCH] sanitize only after checking if not empty --- includes/WP_Admin.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/includes/WP_Admin.php b/includes/WP_Admin.php index d0d43764f..297dc4802 100644 --- a/includes/WP_Admin.php +++ b/includes/WP_Admin.php @@ -2,7 +2,6 @@ namespace NewfoldLabs\WP\Module\Onboarding; use NewfoldLabs\WP\Module\Onboarding\Data\Data; -use SebastianBergmann\CodeCoverage\Util\Percentage; use NewfoldLabs\WP\Module\Onboarding\TaskManagers\PluginInstallTaskManager; use NewfoldLabs\WP\Module\Onboarding\TaskManagers\ThemeInstallTaskManager; @@ -115,11 +114,11 @@ public static function register_assets() { * @return void */ public static function initialize() { - if ( ! empty( sanitize_text_field( $_GET['nfd_plugins'] ) ) && 'true' === sanitize_text_field( $_GET['nfd_plugins'] ) ) { + if ( ! empty( $_GET['nfd_plugins'] ) && 'true' === sanitize_text_field( $_GET['nfd_plugins'] ) ) { PluginInstallTaskManager::queue_initial_installs(); } - if ( ! empty( sanitize_text_field( $_GET['nfd_themes'] ) ) && 'true' === sanitize_text_field( $_GET['nfd_themes'] ) ) { + if ( ! empty( $_GET['nfd_themes'] ) && 'true' === sanitize_text_field( $_GET['nfd_themes'] ) ) { ThemeInstallTaskManager::queue_initial_installs(); }