File tree Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -406,7 +406,10 @@ class Chosen extends AbstractChosen
406
406
@search_field .val ()
407
407
408
408
get_search_text : ->
409
- $ (' <div/>' ).text ($ .trim (this .get_search_field_value ())).html ()
409
+ this .escape_html $ .trim (this .get_search_field_value ())
410
+
411
+ escape_html : (text ) ->
412
+ $ (' <div/>' ).text (text).html ()
410
413
411
414
winnow_results_set_highlight : ->
412
415
selected_results = if not @is_multiple then @search_results .find (" .result-selected.active-result" ) else []
Original file line number Diff line number Diff line change @@ -396,7 +396,10 @@ class @Chosen extends AbstractChosen
396
396
@search_field .value
397
397
398
398
get_search_text : ->
399
- this .get_search_field_value ().strip ().escapeHTML ()
399
+ this .escape_html this .get_search_field_value ().strip ()
400
+
401
+ escape_html : (text ) ->
402
+ text .escapeHTML ()
400
403
401
404
winnow_results_set_highlight : ->
402
405
if not @is_multiple
Original file line number Diff line number Diff line change @@ -45,6 +45,8 @@ class AbstractChosen
45
45
else
46
46
@default_text = @options .placeholder_text_single || @options .placeholder_text || AbstractChosen .default_single_text
47
47
48
+ @default_text = this .escape_html (@default_text )
49
+
48
50
@results_none_found = @form_field .getAttribute (" data-no_results_text" ) || @options .no_results_text || AbstractChosen .default_no_result_text
49
51
50
52
choice_label : (item ) ->
You can’t perform that action at this time.
0 commit comments