diff --git a/plugins/woocommerce/readme.txt b/plugins/woocommerce/readme.txt index ee01563080a..c6ca96c0540 100644 --- a/plugins/woocommerce/readme.txt +++ b/plugins/woocommerce/readme.txt @@ -173,6 +173,7 @@ WooCommerce comes with some sample data you can use to see how products look; im **WooCommerce** +* Fix - Fix StoreAPI erroring when a param is an integer [#52361](https://github.com/woocommerce/woocommerce/pull/52361) * Fix - Product grid blocks: fix Image aspect ratio with WordPress 6.7 [#52431](https://github.com/woocommerce/woocommerce/pull/52431) * Fix - Product Image Gallery: Render placeholder in Editor in WordPress 6.7 [#52432](https://github.com/woocommerce/woocommerce/pull/52432) * Fix - Support situations in which (WooCommerce) translations are inadvertently loaded too early. [#52199](https://github.com/woocommerce/woocommerce/pull/52199) diff --git a/plugins/woocommerce/src/StoreApi/Routes/V1/Products.php b/plugins/woocommerce/src/StoreApi/Routes/V1/Products.php index b58f2a8a689..a930883b4bc 100644 --- a/plugins/woocommerce/src/StoreApi/Routes/V1/Products.php +++ b/plugins/woocommerce/src/StoreApi/Routes/V1/Products.php @@ -301,6 +301,10 @@ class Products extends AbstractRoute { // If the $_REQUEST contains a taxonomy query, add it to the params and sanitize it. foreach ( $_REQUEST as $param => $value ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended + if ( ! is_string( $param ) ) { + continue; + } + if ( str_starts_with( $param, '_unstable_tax_' ) && ! str_ends_with( $param, '_operator' ) ) { $params[ $param ] = array( 'description' => __( 'Limit result set to products assigned a specific category ID.', 'woocommerce' ),