| @@ -609,10 +609,12 @@ | ||
| 609 | 609 | if (!$user) { |
| 610 | 610 | return null; |
| 611 | 611 | } |
| 612 | 612 | |
| 613 | + // Identity only — see CustomerResource::getCurrentCustomer() for why an | |
| 614 | + // email match must never reach a customer row. | |
| 613 | 615 | return Customer::query()->where('user_id', $user->ID) |
| 614 | - ->orWhere('email', $user->user_email) | |
| 616 | + ->orderBy('id', 'ASC') | |
| 615 | 617 | ->first(); |
| 616 | 618 | } |
| 617 | 619 | |
| 618 | 620 | /** |
| @@ -1402,14 +1404,16 @@ | ||
| 1402 | 1404 | $month = (int) Arr::get($anchor, 'month', 0); |
| 1403 | 1405 | |
| 1404 | 1406 | if ($month && $day) { |
| 1405 | 1407 | /* translators: %s is a date, e.g. "on Aug 19" */ |
| 1406 | - return sprintf(__('on %s', 'fluent-cart'), gmdate('M', gmmktime(12, 0, 0, $month, 1, 2001)) . ' ' . $day); | |
| 1408 | + // wp_date(), not gmdate(): gmdate() has no locale, so this month | |
| 1409 | + // name stayed English inside an otherwise translated sentence. | |
| 1410 | + return sprintf(__('on %s', 'fluent-cart'), wp_date('M', gmmktime(12, 0, 0, $month, 1, 2001), new \DateTimeZone('UTC')) . ' ' . $day); | |
| 1407 | 1411 | } |
| 1408 | 1412 | |
| 1409 | 1413 | if ($month) { |
| 1410 | 1414 | /* translators: %s is a month name, e.g. "in August" */ |
| 1411 | - return sprintf(__('in %s', 'fluent-cart'), gmdate('F', gmmktime(12, 0, 0, $month, 1, 2001))); | |
| 1415 | + return sprintf(__('in %s', 'fluent-cart'), wp_date('F', gmmktime(12, 0, 0, $month, 1, 2001), new \DateTimeZone('UTC'))); | |
| 1412 | 1416 | } |
| 1413 | 1417 | |
| 1414 | 1418 | /* translators: %s is an ordinal day of month, e.g. "on the 10th" */ |
| 1415 | 1419 | return sprintf(__('on the %s', 'fluent-cart'), gmdate('jS', gmmktime(12, 0, 0, 1, $day, 2001))); |