Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sanitize nfd_plugins and nfd_themes only after checking it is not empty #210

Merged
merged 1 commit into from
Apr 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions includes/WP_Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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();
}

Expand Down