Skip to content

Commit

Permalink
Escaping quotes in value
Browse files Browse the repository at this point in the history
  • Loading branch information
nulle committed May 22, 2019
1 parent 63d4b15 commit e49026e
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dist/js/select2.full.js
Original file line number Diff line number Diff line change
Expand Up @@ -3162,7 +3162,7 @@ S2.define('select2/data/select',[

var collection = [];
$.each(val, function(k, v) {
var i = self.$element.find('option[value="' + v + '"]');
var i = self.$element.find('option[value="' + v.replace(/["\\]/g, '\\$&') + '"]');
if (i.length) {
collection.push(i.get(0)); // to preserve order, we create a collection of nodes, not jquery elements
}
Expand Down
2 changes: 1 addition & 1 deletion dist/js/select2.full.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/js/select2.js
Original file line number Diff line number Diff line change
Expand Up @@ -3162,7 +3162,7 @@ S2.define('select2/data/select',[

var collection = [];
$.each(val, function(k, v) {
var i = self.$element.find('option[value="' + v + '"]');
var i = self.$element.find('option[value="' + v.replace(/["\\]/g, '\\$&') + '"]');
if (i.length) {
collection.push(i.get(0)); // to preserve order, we create a collection of nodes, not jquery elements
}
Expand Down
2 changes: 1 addition & 1 deletion dist/js/select2.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/js/select2/data/select.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ define([

var collection = [];
$.each(val, function(k, v) {
var i = self.$element.find('option[value="' + v + '"]');
var i = self.$element.find('option[value="' + v.replace(/["\\]/g, '\\$&') + '"]');
if (i.length) {
collection.push(i.get(0)); // to preserve order, we create a collection of nodes, not jquery elements
}
Expand Down

0 comments on commit e49026e

Please sign in to comment.