Commit 4e939fab1c for woocommerce
commit 4e939fab1c594631f62e0945115d3c789e30c63e
Author: Shahed <125728402+dev-shahed@users.noreply.github.com>
Date: Wed Jan 28 19:48:23 2026 +0600
Fix: should_user_verify_order_email() case-sensitive email comparison (#62974)
* Merge upstream/trunk: sync with latest WooCommerce
Resolve BlocksUtil conflict: keep upstream null-check (null === template->content).
* Improve email matching logic in Users utility class to ensure case-insensitive comparison and non-empty checks for session and supplied emails.
* Add changefile(s) from automation for the following project(s): woocommerce
* Resolve merge conflict in BlocksUtil.php - use empty() check for template content
* Restore BlocksUtil.php to match trunk exactly - no changes to this file
* remove local changes from BlocksUtil file
---------
Co-authored-by: woocommercebot <woocommercebot@users.noreply.github.com>
diff --git a/plugins/woocommerce/changelog/62974-fix-email-verification-case-insensitive b/plugins/woocommerce/changelog/62974-fix-email-verification-case-insensitive
new file mode 100644
index 0000000000..8f194ce2a0
--- /dev/null
+++ b/plugins/woocommerce/changelog/62974-fix-email-verification-case-insensitive
@@ -0,0 +1,4 @@
+Significance: patch
+Type: fix
+
+Fixed case-sensitive email verification issue that prevented guests from accessing order payment pages when entering their email address in a different case than stored in the order.
\ No newline at end of file
diff --git a/plugins/woocommerce/src/Internal/Utilities/Users.php b/plugins/woocommerce/src/Internal/Utilities/Users.php
index 7b35f37a9b..357ed8d3a5 100644
--- a/plugins/woocommerce/src/Internal/Utilities/Users.php
+++ b/plugins/woocommerce/src/Internal/Utilities/Users.php
@@ -129,8 +129,8 @@ class Users {
// Email verification is required if the user cannot be identified, or if they supplied an email address but the nonce check failed.
$can_view_orders = current_user_can( 'read_private_shop_orders' );
- $session_email_match = $session_email === $billing_email;
- $supplied_email_match = $supplied_email === $billing_email;
+ $session_email_match = ! empty( $session_email ) && 0 === strcasecmp( $session_email, $billing_email );
+ $supplied_email_match = ! empty( $supplied_email ) && 0 === strcasecmp( $supplied_email, $billing_email );
$email_verification_required = ! $session_email_match && ! $supplied_email_match && ! $can_view_orders;