mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #6977] [MERGED] fix(link): decode share link remarks once #6559
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#6559
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/MHSanaei/3x-ui/pull/6977
Author: @jayhemnani9910
Created: 10/27/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @MHSanaei
Base:
main← Head:fix/link-remark-decode📝 Commits (1)
2ce8477fix(link): decode share link remarks once📊 Changes
2 files changed (+35 additions, -4 deletions)
View changed files
📝
internal/util/link/outbound.go(+4 -4)📝
internal/util/link/outbound_helpers_test.go(+31 -0)📄 Description
Summary
Remarks of imported vless, trojan, hysteria2 and wireguard links are percent-decoded once instead of twice, so
+and%in a remark survive.Why
url.Parsealready decodes the fragment intou.Fragment, anddecodeHashthen decoded it again withurl.QueryUnescape. The subscription server writes remarks withencodeURIComponent(internal/sub/service.go), so a remark comes back changed when one 3x-ui panel imports another's subscription:VIP+VIP%2BVIPUS+EU 1US%2BEU%201US EU 1a%20ba%2520ba bThe shadowsocks parser decodes the raw fragment once and returns the right remark for the same input.
The fix passes
decodeHashthe escaped fragment (u.EscapedFragment()), so these links decode it once, as shadowsocks links do.Type of change
Areas affected
How was this tested?
TestParse_RemarkDecodedOnceininternal/util/link/outbound_helpers_test.goparses those fragments, plus a Cyrillic one, for vless, trojan, hysteria2, wireguard and shadowsocks links. On main it fails 12 times (three remarks across the four URL-form protocols); with the change it passes.go test -shuffle=on -count=1 ./...passes (52 packages).golangci-lint run ./internal/util/link/reports 0 issues.Breaking changes
None.
Checklist
go build ./...and the test suite pass locally.npm run lint,npm run typecheck, andnpm run buildpass.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
[PR #6977] fix(link): decode share link remarks onceto [PR #6977] [MERGED] fix(link): decode share link remarks once