Skip to content

Commit

Permalink
Cherry pick 46972 into release/8.9 (#47050)
Browse files Browse the repository at this point in the history
* Do not urldecode search terms in HPOS searches (#46972)

* Fix HPOS searches involving terms similar to URL-encoded characters

* Make sure search filters are non null

* Prep for cherry pick 46972

---------

Co-authored-by: Jorge A. Torres <jorge.torres@automattic.com>
Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
  • Loading branch information
3 people committed Apr 30, 2024
1 parent 79a95cc commit 98438d8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions plugins/woocommerce/readme.txt
Expand Up @@ -169,6 +169,7 @@ WooCommerce comes with some sample data you can use to see how products look; im

**WooCommerce**

* Fix - Fix HPOS order searches involving terms with characters resembling URL-encoded characters. [#46972](https://github.com/woocommerce/woocommerce/pull/46972)
* Fix - Add a bailout to prevent JavaScript errors if Sourcebuster isn't loaded [#46723](https://github.com/woocommerce/woocommerce/pull/46723)
* Fix - Add a safety check for the numbers with the same value for the separators [#46241](https://github.com/woocommerce/woocommerce/pull/46241)
* Fix - Addresses a fatal error that can occur when applying a coupon within the order editor (where one of the products has been deleted). [#46251](https://github.com/woocommerce/woocommerce/pull/46251)
Expand Down
Expand Up @@ -27,7 +27,7 @@ class OrdersTableSearchQuery {
/**
* Limits the search to a specific field.
*
* @var string
* @var string[]
*/
private $search_filters;

Expand All @@ -40,8 +40,8 @@ class OrdersTableSearchQuery {
*/
public function __construct( OrdersTableQuery $query ) {
$this->query = $query;
$this->search_term = urldecode( $query->get( 's' ) );
$this->search_filters = $this->sanitize_search_filters( urldecode( $query->get( 'search_filter' ) ) );
$this->search_term = $query->get( 's' );
$this->search_filters = $this->sanitize_search_filters( $query->get( 'search_filter' ) ?? '' );
}

/**
Expand Down

0 comments on commit 98438d8

Please sign in to comment.