diff options
author | Giteabot <teabot@gitea.io> | 2023-07-25 02:14:18 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-25 06:14:18 +0000 |
commit | 3e07c54be3988d0d422108711104200bf487c16a (patch) | |
tree | 53abba70768bc81edd34b6d327eeddbab1122376 | |
parent | e2596b0a999b2d2b6ce699ac8b6a3981a89d5bd5 (diff) | |
download | gitea-3e07c54be3988d0d422108711104200bf487c16a.tar.gz gitea-3e07c54be3988d0d422108711104200bf487c16a.zip |
Fix escape problems in the branch selector (#25875) (#26103)
Backport #25875 by @yp05327
Fix #25865
Co-authored-by: yp05327 <576951401@qq.com>
-rw-r--r-- | web_src/js/components/RepoBranchTagSelector.vue | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/web_src/js/components/RepoBranchTagSelector.vue b/web_src/js/components/RepoBranchTagSelector.vue index 5d08575278..4fc3936244 100644 --- a/web_src/js/components/RepoBranchTagSelector.vue +++ b/web_src/js/components/RepoBranchTagSelector.vue @@ -108,7 +108,7 @@ const sfc = { return this.items.filter((item) => item.name.toLowerCase() === this.searchTerm.toLowerCase()).length === 0; }, formActionUrl() { - return `${this.repoLink}/branches/_new/${pathEscapeSegments(this.branchNameSubURL)}`; + return `${this.repoLink}/branches/_new/${this.branchNameSubURL}`; }, }, @@ -274,15 +274,15 @@ export function initRepoBranchTagSelector(selector) { if (data.showBranchesInDropdown && data.branches) { for (const branch of data.branches) { - data.items.push({name: branch, url: branch, branch: true, tag: false, selected: branch === data.defaultBranch}); + data.items.push({name: branch, url: pathEscapeSegments(branch), branch: true, tag: false, selected: branch === data.defaultBranch}); } } if (!data.noTag && data.tags) { for (const tag of data.tags) { if (data.release) { - data.items.push({name: tag, url: tag, branch: false, tag: true, selected: tag === data.release.tagName}); + data.items.push({name: tag, url: pathEscapeSegments(tag), branch: false, tag: true, selected: tag === data.release.tagName}); } else { - data.items.push({name: tag, url: tag, branch: false, tag: true, selected: tag === data.defaultBranch}); + data.items.push({name: tag, url: pathEscapeSegments(tag), branch: false, tag: true, selected: tag === data.defaultBranch}); } } } |