Skip to content

Commit

Permalink
fix(dropdown): fix map parameter on htmlentities
Browse files Browse the repository at this point in the history
Multiple preselected values containing characters needed to be converted into htmlentities where encoded wrong (from the second value) because the related method was called as a .map() callback. However, .map callbacks are called given the index of the array as a second parameter. Unfortunately the given method expected something different which resulted in always encoding the ampersand character which broke the preselection
  • Loading branch information
lubber-de authored Feb 11, 2024
1 parent c98bcb7 commit 9bf4620
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/definitions/modules/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -3825,6 +3825,7 @@
return text.replace(regExp.escape, '\\$&');
},
htmlEntities: function (string, forceAmpersand) {
forceAmpersand = typeof forceAmpersand === 'number' ? false : forceAmpersand;
var
badChars = /["'<>`]/g,
shouldEscape = /["&'<>`]/,
Expand Down

0 comments on commit 9bf4620

Please sign in to comment.