From 8ddbfdd7b720018f64d481bb74abe02ba5337810 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 25 Aug 2026 06:02:26 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E4=BA=86=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E5=B0=8F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Payment/Withdrawal.php | 5 +---- tests/asset-ledger/WithdrawalTest.php | 4 ++-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Payment/Withdrawal.php b/src/Payment/Withdrawal.php index 17c3360a..fe31d27c 100644 --- a/src/Payment/Withdrawal.php +++ b/src/Payment/Withdrawal.php @@ -669,10 +669,7 @@ class Withdrawal { $row['amount'] = $this->database_balance_decimal((string) ($row['amount'] ?? '0')); $row['fee_rate'] = (int) ($meta['fee_rate'] ?? 0); $display = (string) ($meta['account'] ?? $row['account_info'] ?? ''); - $display_length = mb_strlen($display, 'UTF-8'); - $row['display_account'] = $display_length > 4 - ? mb_substr($display, 0, 2, 'UTF-8') . str_repeat('*', max(2, $display_length - 4)) . mb_substr($display, -2, null, 'UTF-8') - : '****'; + $row['display_account'] = $display; $row['source'] = (string) ($meta['source'] ?? 'balance'); return $row; } diff --git a/tests/asset-ledger/WithdrawalTest.php b/tests/asset-ledger/WithdrawalTest.php index 8ba95d7b..94e01026 100644 --- a/tests/asset-ledger/WithdrawalTest.php +++ b/tests/asset-ledger/WithdrawalTest.php @@ -4,7 +4,7 @@ use AKSRT\Payment\Withdrawal; use PHPUnit\Framework\TestCase; final class WithdrawalTest extends TestCase { - public function test_account_display_mask_preserves_utf8_characters(): void { + public function test_admin_account_display_keeps_the_full_account(): void { $method = new ReflectionMethod(Withdrawal::class, 'normalize_row'); $row = $method->invoke(Withdrawal::get_instance(), [ 'account_info' => wp_json_encode(['account' => '账户名称 账户号码']), @@ -12,7 +12,7 @@ final class WithdrawalTest extends TestCase { 'amount' => '95.00', ]); - self::assertSame('账户*****号码', $row['display_account']); + self::assertSame('账户名称 账户号码', $row['display_account']); self::assertSame(1, preg_match('//u', $row['display_account'])); } }