mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 10:56:10 +01:00 
			
		
		
		
	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.
		
			
				
	
	
		
			8 lines
		
	
	
		
			369 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			8 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');
 | |
|   });
 | |
| }
 |