From c50344a2d049aafca1da63a02131b979de478b1f Mon Sep 17 00:00:00 2001 From: Zhu Chenrui Date: Sat, 22 Aug 2026 11:14:57 +0800 Subject: [PATCH 1/2] fix: rewrite legacy forum domains to .uk --- Source/Process.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Process.ts b/Source/Process.ts index ef13b2f..370035d 100644 --- a/Source/Process.ts +++ b/Source/Process.ts @@ -882,7 +882,7 @@ export class Process { continue; } let processedContent: string = ReplyItem["content"]; - processedContent = processedContent.replace(/xmoj-bbs\.tech/g, "xmoj-bbs.me"); + processedContent = processedContent.replace(/xmoj-bbs\.(?:tech|me)/g, "xmoj-script.uk"); ResponseData.Reply.push({ ReplyID: ReplyItem["reply_id"], UserID: ReplyItem["reply_user_id"], From b36c15f2a9d5ddae68d143f405456bc7f798bd04 Mon Sep 17 00:00:00 2001 From: Zhu Chenrui Date: Sat, 22 Aug 2026 11:15:17 +0800 Subject: [PATCH 2/2] test: cover all legacy forum domains --- test/process.test.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/test/process.test.js b/test/process.test.js index f6014dc..19051ed 100644 --- a/test/process.test.js +++ b/test/process.test.js @@ -937,15 +937,24 @@ test('GetPost reports a locked discussion', async () => { assert.deepStrictEqual(result.Data.Lock, { Locked: true, LockPerson: 'admin', LockTime: 999 }); }); -test('GetPost rewrites legacy domain in reply content', async () => { +test('GetPost rewrites all legacy domains in reply content', async () => { const proc = createProcess(); stubGetPostQuery(proc, [ - postRow({ reply_count: 1, reply_id: 1, reply_user_id: 'u1', content: 'see https://xmoj-bbs.tech/a and xmoj-bbs.tech/b', reply_time: 1001 }) + postRow({ + reply_count: 1, + reply_id: 1, + reply_user_id: 'u1', + content: 'see https://xmoj-bbs.tech/a, https://www.xmoj-bbs.me/b, and https://assets.xmoj-bbs.me/c', + reply_time: 1001 + }) ]); const result = await proc.ProcessFunctions['GetPost']({ PostID: 1, Page: 1 }); - assert.strictEqual(result.Data.Reply[0].Content, 'see https://xmoj-bbs.me/a and xmoj-bbs.me/b'); + assert.strictEqual( + result.Data.Reply[0].Content, + 'see https://xmoj-script.uk/a, https://www.xmoj-script.uk/b, and https://assets.xmoj-script.uk/c' + ); }); test('GetPost fails when the discussion does not exist', async () => {