From 96f5eea48e78b5621d3229ac55d6ba12a03b32f5 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Thu, 4 Jan 2024 13:29:31 +1000 Subject: [PATCH] Simplify refinement sanitisation, to avoid PHP Warnings & fatals due to junk inputs. --- .../themes/wporg-main-2022/src/google-search-embed/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/wp-content/themes/wporg-main-2022/src/google-search-embed/index.php b/source/wp-content/themes/wporg-main-2022/src/google-search-embed/index.php index d935f75b..e540a580 100644 --- a/source/wp-content/themes/wporg-main-2022/src/google-search-embed/index.php +++ b/source/wp-content/themes/wporg-main-2022/src/google-search-embed/index.php @@ -62,7 +62,7 @@ function render( $attributes, $content, $block ) { ), ); - $refinement = isset( $_REQUEST['in'] ) ? sanitize_title( wp_unslash( $_REQUEST['in'] ) ) : ''; // phpcs:ignore + $refinement = wp_unslash( $_REQUEST['in'] ?? '' ); // phpcs:ignore if ( in_array( $refinement, [ 'support_forums', 'support_docs', 'developer_documentation' ], true ) ) { $search_config['attributes']['defaultToRefinement'] = $refinement; }