Skip to content

Commit 8e48889

Browse files
Copilotalexr00
andcommitted
URL-encode branch name for safety
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
1 parent 14f043d commit 8e48889

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/github/createPRViewProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ export abstract class BaseCreatePullRequestViewProvider<T extends BasePullReques
522522

523523
// Construct the GitHub URL for creating a PR
524524
// Format: https://github.com/{owner}/{repo}/pull/new/{branch}
525-
const url = `${baseRepo.remote.normalizedHost}/${baseRepo.remote.owner}/${baseRepo.remote.repositoryName}/pull/new/${compareBranch}`;
525+
const url = `${baseRepo.remote.normalizedHost}/${baseRepo.remote.owner}/${baseRepo.remote.repositoryName}/pull/new/${encodeURIComponent(compareBranch)}`;
526526

527527
await vscode.env.openExternal(vscode.Uri.parse(url));
528528
}

0 commit comments

Comments
 (0)