Skip to content
This repository has been archived by the owner on May 2, 2024. It is now read-only.

Commit

Permalink
Merge pull request #62 from 10up/fix/issue-61
Browse files Browse the repository at this point in the history
fix: Issue with Sanitising tax_query #61
  • Loading branch information
jeffpaul authored Feb 15, 2024
2 parents f1fa063 + 85bf5f8 commit 377a353
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion includes/classes/NS_Post_Finder.php
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,11 @@ public function search_posts() {
// Sanitize tax_queries
if ( isset( $_POST['tax_query'] ) ) {
foreach ( $_POST['tax_query'] as $current_tax_query ) {
$args['tax_query'][] = array_map( 'sanitize_text_field', $current_tax_query );
if ( is_array( $current_tax_query ) ) {
$args['tax_query'][] = array_map( 'sanitize_text_field', $current_tax_query );
} else {
$args['tax_query'][] = sanitize_text_field( $current_tax_query );
}
}
}

Expand Down

0 comments on commit 377a353

Please sign in to comment.