-
Notifications
You must be signed in to change notification settings - Fork 3
Fix legacy forum links after .uk migration #71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -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"); | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Because the new Useful? React with 👍 / 👎.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P3: The rewrite regex /xmoj-bbs.(?:tech|me)/g has no trailing word boundary, so it matches the prefix of any token that merely begins with the legacy host text. 'xmoj-bbs.member' becomes 'xmoj-script.ukmber' and 'xmoj-bbs.meeting' becomes 'xmoj-script.uketing'. Add \b after the TLD alternation so only the full hostname is rewritten; subdomain preservation (www./assets.) is unaffected because the boundary sits after the replaced TLD. Prompt for AI agents
Suggested change
|
||||||
| ResponseData.Reply.push({ | ||||||
| ReplyID: ReplyItem["reply_id"], | ||||||
| UserID: ReplyItem["reply_user_id"], | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue (bug_risk): The unbounded, case-sensitive replacement rewrites any text containing
xmoj-bbs.techorxmoj-bbs.me, including unrelated hostnames such asxmoj-bbs.me.example.comand uppercase forms of the domain, producing incorrect or still-invalid links.Triggers: When a reply contains a hostname that merely contains a legacy domain string or uses uppercase characters.
Suggested fix: Match the domain as a case-insensitive hostname with URL boundary checks, so only the exact legacy host and its subdomains are rewritten.