mirror of
https://codeberg.org/forgejo/forgejo
synced 2024-12-11 14:01:58 +01:00
661d3d28e9
In the case of misuse or misunderstanding from a developer whereby, if `sel` can receive user-controlled data, jQuery `$(sel)` can lead to the creation of a new element. Current usage is using hard-coded selectors in the templates, but nobody prevents that from expanding to user-controlled somehow.
7 lines
369 B
JavaScript
7 lines
369 B
JavaScript
export function initRepoBranchButton() {
|
|
$('.show-create-branch-modal.button').on('click', function () {
|
|
$('#create-branch-form')[0].action = $('#create-branch-form').data('base-action') + $(this).data('branch-from-urlcomponent');
|
|
$('#modal-create-branch-from-span').text($(this).data('branch-from'));
|
|
$.find($(this).data('modal')).modal('show');
|
|
});
|
|
}
|