Skip to content

Commit

Permalink
Simplify refinement sanitisation, to avoid PHP Warnings & fatals due …
Browse files Browse the repository at this point in the history
…to junk inputs.
  • Loading branch information
dd32 authored Jan 4, 2024
1 parent 109fb23 commit 96f5eea
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 96f5eea

Please sign in to comment.