fix potential xss in multiselect

This commit is contained in:
Robin Appelman 2012-06-09 15:07:09 +02:00
parent 344299a074
commit cfe219fbb9
1 changed files with 9 additions and 3 deletions

View File

@ -57,8 +57,11 @@
element=$(element);
var item=element.val();
var id='ms'+multiSelectId+'-option-'+item;
var input=$('<input id="'+id+'" type="checkbox"/>');
var label=$('<label for="'+id+'">'+item+'</label>');
var input=$('<input type="checkbox"/>');
input.attr('id',id);
var label=$('<label/>');
label.attr('for',id);
label.text(item);
if(settings.checked.indexOf(item)!=-1 || checked){
input.attr('checked',true);
}
@ -130,7 +133,10 @@
li.text('+ '+settings.createText);
li.before(createItem(this));
var select=button.parent().next();
select.append($('<option selected="selected" value="'+$(this).val()+'">'+$(this).val()+'</option>'));
var option=$('<option selected="selected"/>');
option.attr('value',$(this).val());
option.text($(this).val());
select.append(optione);
li.prev().children('input').trigger('click');
button.parent().data('preventHide',false);
if(settings.createCallback){