Skip to content

Commit 3e07c54

Browse files
GiteaBotyp05327
andauthored
Fix escape problems in the branch selector (go-gitea#25875) (go-gitea#26103)
Backport go-gitea#25875 by @yp05327 Fix go-gitea#25865 Co-authored-by: yp05327 <576951401@qq.com>
1 parent e2596b0 commit 3e07c54

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

web_src/js/components/RepoBranchTagSelector.vue

+4-4
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ const sfc = {
108108
return this.items.filter((item) => item.name.toLowerCase() === this.searchTerm.toLowerCase()).length === 0;
109109
},
110110
formActionUrl() {
111-
return `${this.repoLink}/branches/_new/${pathEscapeSegments(this.branchNameSubURL)}`;
111+
return `${this.repoLink}/branches/_new/${this.branchNameSubURL}`;
112112
},
113113
},
114114
@@ -274,15 +274,15 @@ export function initRepoBranchTagSelector(selector) {
274274
275275
if (data.showBranchesInDropdown && data.branches) {
276276
for (const branch of data.branches) {
277-
data.items.push({name: branch, url: branch, branch: true, tag: false, selected: branch === data.defaultBranch});
277+
data.items.push({name: branch, url: pathEscapeSegments(branch), branch: true, tag: false, selected: branch === data.defaultBranch});
278278
}
279279
}
280280
if (!data.noTag && data.tags) {
281281
for (const tag of data.tags) {
282282
if (data.release) {
283-
data.items.push({name: tag, url: tag, branch: false, tag: true, selected: tag === data.release.tagName});
283+
data.items.push({name: tag, url: pathEscapeSegments(tag), branch: false, tag: true, selected: tag === data.release.tagName});
284284
} else {
285-
data.items.push({name: tag, url: tag, branch: false, tag: true, selected: tag === data.defaultBranch});
285+
data.items.push({name: tag, url: pathEscapeSegments(tag), branch: false, tag: true, selected: tag === data.defaultBranch});
286286
}
287287
}
288288
}

0 commit comments

Comments
 (0)