Skip to content

Commit 29c4ae7

Browse files
committed
Ensure all parameters values are properly sanitized
1 parent 2ce8265 commit 29c4ae7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

includes/Admin/SharedBlocksListTable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function prepare_items(): void {
4747
$query = new Query(
4848
[
4949
'per_page' => $per_page,
50-
's' => $_GET['s'] ?? '',
50+
's' => isset( $_GET['s'] ) ? sanitize_text_field( $_GET['s'] ) : '',
5151
'site__in' => isset( $_GET['on_current_site'] ) ? get_current_blog_id() : '',
5252
]
5353
);

includes/Preview.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ public function maybe_do_preview(): void {
3535

3636
$site_id = (int) ( $_GET['site_id'] ?? 0 );
3737
$post_id = (int) ( $_GET['post_id'] ?? 0 );
38-
$block_id = (string) ( $_GET['block_id'] ?? '' );
39-
$request_token = (string) ( $_GET['token'] ?? '' );
38+
$block_id = isset( $_GET['block_id'] ) ? sanitize_text_field( (string) $_GET['block_id'] ) : '';
39+
$request_token = isset( $_GET['token'] ) ? sanitize_text_field( (string) $_GET['token'] ) : '';
4040
//phpcs:enable WordPress.Security.NonceVerification.Recommended
4141

4242
if ( 0 === $site_id || 0 === $post_id || '' === $block_id || '' === $request_token ) {

0 commit comments

Comments
 (0)