Skip to content

Commit 7f0ff49

Browse files
fix: sanitize tab input and improve support page rendering
1 parent 1d9791f commit 7f0ff49

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

includes/admin/feedzy-rss-feeds-admin.php

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -278,14 +278,15 @@ public function enqueue_styles_admin() {
278278
}
279279

280280
// phpcs:ignore WordPress.Security.NonceVerification.Recommended
281-
if ( 'feedzy_page_feedzy-support' === $screen->base &&
282-
(
283-
( isset( $_GET['tab'] ) && 'improve' === $_GET['tab'] )
284-
|| ( 'edit' !== $screen->base && 'feedzy_imports' === $screen->post_type )
285-
|| ( isset( $_GET['tab'] ) && 'license' === $_GET['tab'] )
281+
$tab = isset( $_GET['tab'] ) ? sanitize_text_field( wp_unslash( $_GET['tab'] ) ) : '';
282+
283+
if ( 'feedzy_page_feedzy-support' === $screen->base &&
284+
(
285+
( 'improve' === $tab )
286+
|| ( 'edit' !== $screen->base && 'feedzy_imports' === $screen->post_type )
287+
|| ( 'license' === $tab )
286288
)
287289
) {
288-
289290
$asset_file = include FEEDZY_ABSPATH . '/build/feedback/index.asset.php';
290291
wp_enqueue_script( $this->plugin_name . '_feedback', FEEDZY_ABSURL . 'build/feedback/index.js', array_merge( $asset_file['dependencies'], array( 'wp-editor', 'wp-api', 'lodash' ) ), $asset_file['version'], true );
291292
wp_enqueue_style( 'wp-block-editor' );
@@ -1003,7 +1004,12 @@ public function feedzy_menu_pages() {
10031004
}
10041005
}
10051006

1006-
public function rss_to_social_menu() {
1007+
/**
1008+
* Method to render the support page.
1009+
*
1010+
* @access public
1011+
*/
1012+
public function rss_to_social_menu(): void {
10071013
$capability = feedzy_current_user_can();
10081014
if ( ! $capability ) {
10091015
return;
@@ -1044,8 +1050,6 @@ function () {
10441050
),
10451051
)
10461052
);
1047-
1048-
$submenu['feedzy-admin-menu'] = array_values( $submenu['feedzy-admin-menu'] );
10491053
}
10501054
}
10511055

0 commit comments

Comments
 (0)