Skip to content

Commit

Permalink
Fix escape problems in the branch selector (go-gitea#25875) (go-gitea…
Browse files Browse the repository at this point in the history
…#26103)

Backport go-gitea#25875 by @yp05327

Fix go-gitea#25865

Co-authored-by: yp05327 <576951401@qq.com>
  • Loading branch information
GiteaBot and yp05327 authored Jul 25, 2023
1 parent e2596b0 commit 3e07c54
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions web_src/js/components/RepoBranchTagSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;
},
},
Expand Down Expand Up @@ -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});
}
}
}
Expand Down

0 comments on commit 3e07c54

Please sign in to comment.