From 40f0e812eeb3d7d185d511f4aa3bebb459fc8b59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Bouc=CC=8Cek?= Date: Fri, 19 Mar 2021 13:02:18 +0100 Subject: [PATCH] Admin: Fix XSS in generated JS --- src/Admin.php | 46 +++++++++++++++++++++------------------------- 1 file changed, 21 insertions(+), 25 deletions(-) diff --git a/src/Admin.php b/src/Admin.php index 10dc3ce..ae917fa 100644 --- a/src/Admin.php +++ b/src/Admin.php @@ -154,34 +154,30 @@ public function remove_quick_edit( $actions, $post ) { public function publishing_actions() { $mg_post_type = 'ssc_group'; global $post; - if ( $post && $post->post_type == $mg_post_type ) { - echo ''; - } ?> + + $group = new Group(); + $groups = $group->get_groups(); + + $outputGroups = [[ 'text' => __( 'Doesn\'t matter', 'simpleshop-cz' ), 'value' => '' ]]; + + foreach ( $groups as $value => $text ) { + $outputGroups[] = [ 'text' => $text, 'value' => (string)$value ]; + } + ?> + + post_type === $mg_post_type ) : ?> + + - id || 'user-edit' === $current_screen->id) { + if ( 'profile' === $current_screen->id || 'user-edit' === $current_screen->id ) { wp_enqueue_script( 'jquery-ui-datepicker' ); } }