@automattic/newspack-blocks 4.27.1-hotfix-remove-hidden-checkout-fields.3 → 4.27.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,9 +1,9 @@
1
- ## @automattic/newspack-blocks [4.27.1-hotfix-remove-hidden-checkout-fields.3](https://github.com/Automattic/newspack-workspace/compare/newspack-blocks@4.27.1-hotfix-remove-hidden-checkout-fields.2...newspack-blocks@4.27.1-hotfix-remove-hidden-checkout-fields.3) (2026-07-10)
1
+ ## @automattic/newspack-blocks [4.27.1](https://github.com/Automattic/newspack-workspace/compare/newspack-blocks@4.27.0...newspack-blocks@4.27.1) (2026-07-14)
2
2
 
3
3
 
4
4
  ### Bug Fixes
5
5
 
6
- * **blocks:** scope billing fields enforcement to modal checkout ([00dca75](https://github.com/Automattic/newspack-workspace/commit/00dca7576c63715825cba7adf92429fa8a01c0f7))
6
+ * **blocks:** fix express checkout address validation in modal checkout ([#597](https://github.com/Automattic/newspack-workspace/issues/597)) ([09e001f](https://github.com/Automattic/newspack-workspace/commit/09e001fb8333ae9ab5f7d03c894e9bbeefe3144c))
7
7
 
8
8
  # @automattic/newspack-blocks [4.27.0](https://github.com/Automattic/newspack-workspace/compare/newspack-blocks@4.26.8...newspack-blocks@4.27.0) (2026-07-08)
9
9
 
@@ -1405,6 +1405,11 @@ final class Modal_Checkout {
1405
1405
  * is scrubbed. Runs on rest_pre_dispatch because the validation happens
1406
1406
  * during dispatch.
1407
1407
  *
1408
+ * The shipping address is intentionally out of scope. Carts that need a
1409
+ * shipping address bail below, and wallets return only billing contact when
1410
+ * shipping is not requested, so a virtual-cart request carries no shipping
1411
+ * address to scrub.
1412
+ *
1408
1413
  * Scoped to requests originating from the modal checkout, so any Store API
1409
1414
  * checkout outside the modal (e.g. the blocks checkout page or express
1410
1415
  * buttons on product pages) keeps stock behavior.
@@ -1477,7 +1482,14 @@ final class Modal_Checkout {
1477
1482
  private static function is_modal_checkout_referer() {
1478
1483
  $referer = isset( $_SERVER['HTTP_REFERER'] ) ? esc_url_raw( wp_unslash( $_SERVER['HTTP_REFERER'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
1479
1484
 
1480
- return false !== strpos( $referer, 'modal_checkout=1' );
1485
+ if ( ! $referer ) {
1486
+ return false;
1487
+ }
1488
+
1489
+ $query_string = \wp_parse_url( $referer, PHP_URL_QUERY );
1490
+ \wp_parse_str( (string) $query_string, $query_params );
1491
+
1492
+ return ! empty( $query_params['modal_checkout'] );
1481
1493
  }
1482
1494
 
1483
1495
  /**
@@ -1494,6 +1506,7 @@ final class Modal_Checkout {
1494
1506
  if (
1495
1507
  ! in_array( 'billing_state', $billing_fields, true ) &&
1496
1508
  ! empty( $address['state'] ) &&
1509
+ is_string( $address['state'] ) &&
1497
1510
  $country
1498
1511
  ) {
1499
1512
  $states = \WC()->countries->get_states( $country );
@@ -1511,6 +1524,7 @@ final class Modal_Checkout {
1511
1524
  if (
1512
1525
  ! in_array( 'billing_postcode', $billing_fields, true ) &&
1513
1526
  ! empty( $address['postcode'] ) &&
1527
+ is_string( $address['postcode'] ) &&
1514
1528
  ! \WC_Validation::is_postcode( $address['postcode'], $country )
1515
1529
  ) {
1516
1530
  $address['postcode'] = '';
@@ -7,7 +7,7 @@
7
7
  * Author URI: https://newspack.com/
8
8
  * Text Domain: newspack-blocks
9
9
  * Domain Path: /languages
10
- * Version: 4.27.1-hotfix-remove-hidden-checkout-fields.3
10
+ * Version: 4.27.1
11
11
  *
12
12
  * @package Newspack_Blocks
13
13
  */
@@ -15,7 +15,7 @@
15
15
  define( 'NEWSPACK_BLOCKS__PLUGIN_FILE', __FILE__ );
16
16
  define( 'NEWSPACK_BLOCKS__BLOCKS_DIRECTORY', 'dist/' );
17
17
  define( 'NEWSPACK_BLOCKS__PLUGIN_DIR', plugin_dir_path( NEWSPACK_BLOCKS__PLUGIN_FILE ) );
18
- define( 'NEWSPACK_BLOCKS__VERSION', '4.27.1-hotfix-remove-hidden-checkout-fields.3' );
18
+ define( 'NEWSPACK_BLOCKS__VERSION', '4.27.1' );
19
19
 
20
20
  require_once NEWSPACK_BLOCKS__PLUGIN_DIR . 'includes/class-newspack-blocks.php';
21
21
  require_once NEWSPACK_BLOCKS__PLUGIN_DIR . 'includes/class-newspack-blocks-api.php';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automattic/newspack-blocks",
3
- "version": "4.27.1-hotfix-remove-hidden-checkout-fields.3",
3
+ "version": "4.27.1",
4
4
  "author": "Automattic",
5
5
  "description": "=== Newspack Blocks === Contributors: (this should be a list of wordpress.org userid's) Donate link: https://example.com/ Tags: comments, spam Requires at least: 4.5 Tested up to: 5.1.1 Stable tag: 0.1.0 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html",
6
6
  "repository": {
@@ -3,7 +3,7 @@
3
3
  'name' => 'automattic/newspack-blocks',
4
4
  'pretty_version' => 'dev-main',
5
5
  'version' => 'dev-main',
6
- 'reference' => '00dca7576c63715825cba7adf92429fa8a01c0f7',
6
+ 'reference' => '09e001fb8333ae9ab5f7d03c894e9bbeefe3144c',
7
7
  'type' => 'wordpress-plugin',
8
8
  'install_path' => __DIR__ . '/../../',
9
9
  'aliases' => array(),
@@ -13,7 +13,7 @@
13
13
  'automattic/newspack-blocks' => array(
14
14
  'pretty_version' => 'dev-main',
15
15
  'version' => 'dev-main',
16
- 'reference' => '00dca7576c63715825cba7adf92429fa8a01c0f7',
16
+ 'reference' => '09e001fb8333ae9ab5f7d03c894e9bbeefe3144c',
17
17
  'type' => 'wordpress-plugin',
18
18
  'install_path' => __DIR__ . '/../../',
19
19
  'aliases' => array(),