##// END OF EJS Templates
select2: always escape .text attributes to prevent XSS via...
ergo -
r2179:a3d55bf9 default
parent child Browse files
Show More
@@ -241,7 +241,7 b' var formatSelect2SelectionRefs = functio'
241 } else if (commit_ref.type === 'book'){
241 } else if (commit_ref.type === 'book'){
242 tmpl = tmpl.concat('<i class="icon-bookmark"></i> ');
242 tmpl = tmpl.concat('<i class="icon-bookmark"></i> ');
243 }
243 }
244 return tmpl.concat(commit_ref.text);
244 return tmpl.concat(escapeHtml(commit_ref.text));
245 };
245 };
246
246
247 // takes a given html element and scrolls it down offset pixels
247 // takes a given html element and scrolls it down offset pixels
@@ -35,7 +35,6 b' var select2RefBaseSwitcher = function(ta'
35 $(targetElement).select2({
35 $(targetElement).select2({
36 cachedDataSource: {},
36 cachedDataSource: {},
37 dropdownAutoWidth: true,
37 dropdownAutoWidth: true,
38 formatResult: formatResult,
39 width: "resolve",
38 width: "resolve",
40 containerCssClass: "drop-menu",
39 containerCssClass: "drop-menu",
41 dropdownCssClass: "drop-menu-dropdown",
40 dropdownCssClass: "drop-menu-dropdown",
@@ -59,11 +58,10 b' var select2RefBaseSwitcher = function(ta'
59 });
58 });
60 }
59 }
61 },
60 },
62
63 initSelection: function(element, callback) {
61 initSelection: function(element, callback) {
64 callback(initialData);
62 callback(initialData);
65 },
63 },
66
64 formatResult: formatResult,
67 formatSelection: formatSelection
65 formatSelection: formatSelection
68 });
66 });
69
67
General Comments 0
You need to be logged in to leave comments. Login now